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>
Bu işleme şunda yer alıyor:
@@ -1424,25 +1424,25 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait)
|
||||
__poll_t res = 0;
|
||||
|
||||
if (v4l2_event_pending(&fh->fh))
|
||||
res = POLLPRI;
|
||||
else if (req_events & POLLPRI)
|
||||
res = EPOLLPRI;
|
||||
else if (req_events & EPOLLPRI)
|
||||
poll_wait(file, &fh->fh.wait, wait);
|
||||
if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
|
||||
return res | POLLERR;
|
||||
return res | EPOLLERR;
|
||||
|
||||
if (!!is_res_streaming(fh->dev, fh))
|
||||
return res | POLLERR;
|
||||
return res | EPOLLERR;
|
||||
|
||||
if (!is_res_read(fh->dev, fh)) {
|
||||
/* streaming capture */
|
||||
if (list_empty(&fh->vb_vidq.stream))
|
||||
return res | POLLERR;
|
||||
return res | EPOLLERR;
|
||||
buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream);
|
||||
poll_wait(file, &buf->vb.done, wait);
|
||||
if (buf->vb.state == VIDEOBUF_DONE ||
|
||||
buf->vb.state == VIDEOBUF_ERROR)
|
||||
return res | POLLIN | POLLRDNORM;
|
||||
} else if (req_events & (POLLIN | POLLRDNORM)) {
|
||||
return res | EPOLLIN | EPOLLRDNORM;
|
||||
} else if (req_events & (EPOLLIN | EPOLLRDNORM)) {
|
||||
/* read() capture */
|
||||
return res | videobuf_poll_stream(file, &fh->vb_vidq, wait);
|
||||
}
|
||||
|
Yeni konuda referans
Bir kullanıcı engelle