diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2005-09-06 18:17:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:35 -0400 |
commit | 5e5d7a22292613e55da8e91d75bcc062fd861f41 (patch) | |
tree | 052ad4b7bfcc8fcd21a94acca58393a963bd3b06 | |
parent | 9c45817f41af987277353e463c78a1c6beb37da2 (diff) |
[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: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/pipe.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -415,6 +415,10 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
415 | 415 | ||
416 | if (filp->f_mode & FMODE_WRITE) { | 416 | if (filp->f_mode & FMODE_WRITE) { |
417 | mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; | 417 | mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; |
418 | /* | ||
419 | * Most Unices do not set POLLERR for FIFOs but on Linux they | ||
420 | * behave exactly like pipes for poll(). | ||
421 | */ | ||
418 | if (!PIPE_READERS(*inode)) | 422 | if (!PIPE_READERS(*inode)) |
419 | mask |= POLLERR; | 423 | mask |= POLLERR; |
420 | } | 424 | } |
@@ -422,9 +426,6 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
422 | return mask; | 426 | return mask; |
423 | } | 427 | } |
424 | 428 | ||
425 | /* FIXME: most Unices do not set POLLERR for fifos */ | ||
426 | #define fifo_poll pipe_poll | ||
427 | |||
428 | static int | 429 | static int |
429 | pipe_release(struct inode *inode, int decr, int decw) | 430 | pipe_release(struct inode *inode, int decr, int decw) |
430 | { | 431 | { |
@@ -568,7 +569,7 @@ struct file_operations read_fifo_fops = { | |||
568 | .read = pipe_read, | 569 | .read = pipe_read, |
569 | .readv = pipe_readv, | 570 | .readv = pipe_readv, |
570 | .write = bad_pipe_w, | 571 | .write = bad_pipe_w, |
571 | .poll = fifo_poll, | 572 | .poll = pipe_poll, |
572 | .ioctl = pipe_ioctl, | 573 | .ioctl = pipe_ioctl, |
573 | .open = pipe_read_open, | 574 | .open = pipe_read_open, |
574 | .release = pipe_read_release, | 575 | .release = pipe_read_release, |
@@ -580,7 +581,7 @@ struct file_operations write_fifo_fops = { | |||
580 | .read = bad_pipe_r, | 581 | .read = bad_pipe_r, |
581 | .write = pipe_write, | 582 | .write = pipe_write, |
582 | .writev = pipe_writev, | 583 | .writev = pipe_writev, |
583 | .poll = fifo_poll, | 584 | .poll = pipe_poll, |
584 | .ioctl = pipe_ioctl, | 585 | .ioctl = pipe_ioctl, |
585 | .open = pipe_write_open, | 586 | .open = pipe_write_open, |
586 | .release = pipe_write_release, | 587 | .release = pipe_write_release, |
@@ -593,7 +594,7 @@ struct file_operations rdwr_fifo_fops = { | |||
593 | .readv = pipe_readv, | 594 | .readv = pipe_readv, |
594 | .write = pipe_write, | 595 | .write = pipe_write, |
595 | .writev = pipe_writev, | 596 | .writev = pipe_writev, |
596 | .poll = fifo_poll, | 597 | .poll = pipe_poll, |
597 | .ioctl = pipe_ioctl, | 598 | .ioctl = pipe_ioctl, |
598 | .open = pipe_rdwr_open, | 599 | .open = pipe_rdwr_open, |
599 | .release = pipe_rdwr_release, | 600 | .release = pipe_rdwr_release, |