Commit 5e5d7a22292613e55da8e91d75bcc062fd861f41
Committed by
Linus Torvalds
1 parent
9c45817f41
Exists in
master
and in
4 other branches
[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>
Showing 1 changed file with 7 additions and 6 deletions Side-by-side Diff
fs/pipe.c
... | ... | @@ -415,6 +415,10 @@ |
415 | 415 | |
416 | 416 | if (filp->f_mode & FMODE_WRITE) { |
417 | 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 | 422 | if (!PIPE_READERS(*inode)) |
419 | 423 | mask |= POLLERR; |
420 | 424 | } |
... | ... | @@ -422,9 +426,6 @@ |
422 | 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 | 429 | static int |
429 | 430 | pipe_release(struct inode *inode, int decr, int decw) |
430 | 431 | { |
... | ... | @@ -568,7 +569,7 @@ |
568 | 569 | .read = pipe_read, |
569 | 570 | .readv = pipe_readv, |
570 | 571 | .write = bad_pipe_w, |
571 | - .poll = fifo_poll, | |
572 | + .poll = pipe_poll, | |
572 | 573 | .ioctl = pipe_ioctl, |
573 | 574 | .open = pipe_read_open, |
574 | 575 | .release = pipe_read_release, |
... | ... | @@ -580,7 +581,7 @@ |
580 | 581 | .read = bad_pipe_r, |
581 | 582 | .write = pipe_write, |
582 | 583 | .writev = pipe_writev, |
583 | - .poll = fifo_poll, | |
584 | + .poll = pipe_poll, | |
584 | 585 | .ioctl = pipe_ioctl, |
585 | 586 | .open = pipe_write_open, |
586 | 587 | .release = pipe_write_release, |
... | ... | @@ -593,7 +594,7 @@ |
593 | 594 | .readv = pipe_readv, |
594 | 595 | .write = pipe_write, |
595 | 596 | .writev = pipe_writev, |
596 | - .poll = fifo_poll, | |
597 | + .poll = pipe_poll, | |
597 | 598 | .ioctl = pipe_ioctl, |
598 | 599 | .open = pipe_rdwr_open, |
599 | 600 | .release = pipe_rdwr_release, |