Commit 5e5d7a22 authored by Pekka Enberg's avatar Pekka Enberg Committed by Linus Torvalds

[PATCH] pipe: remove redundant fifo_poll abstraction

Remove a redundant fifo_poll() abstraction from fs/pipe.c and adds a big
fat comment stating we set POLLERR for FIFOs too on Linux unlike most
Unices.
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9c45817f
...@@ -415,6 +415,10 @@ pipe_poll(struct file *filp, poll_table *wait) ...@@ -415,6 +415,10 @@ pipe_poll(struct file *filp, poll_table *wait)
if (filp->f_mode & FMODE_WRITE) { if (filp->f_mode & FMODE_WRITE) {
mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0;
/*
* Most Unices do not set POLLERR for FIFOs but on Linux they
* behave exactly like pipes for poll().
*/
if (!PIPE_READERS(*inode)) if (!PIPE_READERS(*inode))
mask |= POLLERR; mask |= POLLERR;
} }
...@@ -422,9 +426,6 @@ pipe_poll(struct file *filp, poll_table *wait) ...@@ -422,9 +426,6 @@ pipe_poll(struct file *filp, poll_table *wait)
return mask; return mask;
} }
/* FIXME: most Unices do not set POLLERR for fifos */
#define fifo_poll pipe_poll
static int static int
pipe_release(struct inode *inode, int decr, int decw) pipe_release(struct inode *inode, int decr, int decw)
{ {
...@@ -568,7 +569,7 @@ struct file_operations read_fifo_fops = { ...@@ -568,7 +569,7 @@ struct file_operations read_fifo_fops = {
.read = pipe_read, .read = pipe_read,
.readv = pipe_readv, .readv = pipe_readv,
.write = bad_pipe_w, .write = bad_pipe_w,
.poll = fifo_poll, .poll = pipe_poll,
.ioctl = pipe_ioctl, .ioctl = pipe_ioctl,
.open = pipe_read_open, .open = pipe_read_open,
.release = pipe_read_release, .release = pipe_read_release,
...@@ -580,7 +581,7 @@ struct file_operations write_fifo_fops = { ...@@ -580,7 +581,7 @@ struct file_operations write_fifo_fops = {
.read = bad_pipe_r, .read = bad_pipe_r,
.write = pipe_write, .write = pipe_write,
.writev = pipe_writev, .writev = pipe_writev,
.poll = fifo_poll, .poll = pipe_poll,
.ioctl = pipe_ioctl, .ioctl = pipe_ioctl,
.open = pipe_write_open, .open = pipe_write_open,
.release = pipe_write_release, .release = pipe_write_release,
...@@ -593,7 +594,7 @@ struct file_operations rdwr_fifo_fops = { ...@@ -593,7 +594,7 @@ struct file_operations rdwr_fifo_fops = {
.readv = pipe_readv, .readv = pipe_readv,
.write = pipe_write, .write = pipe_write,
.writev = pipe_writev, .writev = pipe_writev,
.poll = fifo_poll, .poll = pipe_poll,
.ioctl = pipe_ioctl, .ioctl = pipe_ioctl,
.open = pipe_rdwr_open, .open = pipe_rdwr_open,
.release = pipe_rdwr_release, .release = pipe_rdwr_release,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment