vfs: do bulk POLL* -> EPOLL* replacement
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -1328,7 +1328,7 @@ __scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep)
|
||||
if (ep->state == SCIFEP_CONNECTED ||
|
||||
ep->state == SCIFEP_DISCONNECTED ||
|
||||
ep->conn_err)
|
||||
mask |= POLLOUT;
|
||||
mask |= EPOLLOUT;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
@@ -1338,34 +1338,34 @@ __scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep)
|
||||
_scif_poll_wait(f, &ep->conwq, wait, ep);
|
||||
if (ep->state == SCIFEP_LISTENING) {
|
||||
if (ep->conreqcnt)
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Endpoint is connected or disconnected */
|
||||
if (ep->state == SCIFEP_CONNECTED || ep->state == SCIFEP_DISCONNECTED) {
|
||||
if (poll_requested_events(wait) & POLLIN)
|
||||
if (poll_requested_events(wait) & EPOLLIN)
|
||||
_scif_poll_wait(f, &ep->recvwq, wait, ep);
|
||||
if (poll_requested_events(wait) & POLLOUT)
|
||||
if (poll_requested_events(wait) & EPOLLOUT)
|
||||
_scif_poll_wait(f, &ep->sendwq, wait, ep);
|
||||
if (ep->state == SCIFEP_CONNECTED ||
|
||||
ep->state == SCIFEP_DISCONNECTED) {
|
||||
/* Data can be read without blocking */
|
||||
if (scif_rb_count(&ep->qp_info.qp->inbound_q, 1))
|
||||
mask |= POLLIN;
|
||||
mask |= EPOLLIN;
|
||||
/* Data can be written without blocking */
|
||||
if (scif_rb_space(&ep->qp_info.qp->outbound_q))
|
||||
mask |= POLLOUT;
|
||||
/* Return POLLHUP if endpoint is disconnected */
|
||||
mask |= EPOLLOUT;
|
||||
/* Return EPOLLHUP if endpoint is disconnected */
|
||||
if (ep->state == SCIFEP_DISCONNECTED)
|
||||
mask |= POLLHUP;
|
||||
mask |= EPOLLHUP;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return POLLERR if the endpoint is in none of the above states */
|
||||
mask |= POLLERR;
|
||||
/* Return EPOLLERR if the endpoint is in none of the above states */
|
||||
mask |= EPOLLERR;
|
||||
exit:
|
||||
spin_unlock(&ep->lock);
|
||||
return mask;
|
||||
@@ -1398,10 +1398,10 @@ scif_poll(struct scif_pollepd *ufds, unsigned int nfds, long timeout_msecs)
|
||||
pt = &table.pt;
|
||||
while (1) {
|
||||
for (i = 0; i < nfds; i++) {
|
||||
pt->_key = ufds[i].events | POLLERR | POLLHUP;
|
||||
pt->_key = ufds[i].events | EPOLLERR | EPOLLHUP;
|
||||
mask = __scif_pollfd(ufds[i].epd->anon,
|
||||
pt, ufds[i].epd);
|
||||
mask &= ufds[i].events | POLLERR | POLLHUP;
|
||||
mask &= ufds[i].events | EPOLLERR | EPOLLHUP;
|
||||
if (mask) {
|
||||
count++;
|
||||
pt->_qproc = NULL;
|
||||
|
Reference in New Issue
Block a user