diff options
Diffstat (limited to 'fs/pipe.c')
-rw-r--r-- | fs/pipe.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -39,7 +39,11 @@ void pipe_wait(struct inode * inode) | |||
39 | { | 39 | { |
40 | DEFINE_WAIT(wait); | 40 | DEFINE_WAIT(wait); |
41 | 41 | ||
42 | prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE); | 42 | /* |
43 | * Pipes are system-local resources, so sleeping on them | ||
44 | * is considered a noninteractive wait: | ||
45 | */ | ||
46 | prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE); | ||
43 | up(PIPE_SEM(*inode)); | 47 | up(PIPE_SEM(*inode)); |
44 | schedule(); | 48 | schedule(); |
45 | finish_wait(PIPE_WAIT(*inode), &wait); | 49 | finish_wait(PIPE_WAIT(*inode), &wait); |
@@ -415,6 +419,10 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
415 | 419 | ||
416 | if (filp->f_mode & FMODE_WRITE) { | 420 | if (filp->f_mode & FMODE_WRITE) { |
417 | mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; | 421 | mask |= (nrbufs < PIPE_BUFFERS) ? POLLOUT | POLLWRNORM : 0; |
422 | /* | ||
423 | * Most Unices do not set POLLERR for FIFOs but on Linux they | ||
424 | * behave exactly like pipes for poll(). | ||
425 | */ | ||
418 | if (!PIPE_READERS(*inode)) | 426 | if (!PIPE_READERS(*inode)) |
419 | mask |= POLLERR; | 427 | mask |= POLLERR; |
420 | } | 428 | } |
@@ -422,9 +430,6 @@ pipe_poll(struct file *filp, poll_table *wait) | |||
422 | return mask; | 430 | return mask; |
423 | } | 431 | } |
424 | 432 | ||
425 | /* FIXME: most Unices do not set POLLERR for fifos */ | ||
426 | #define fifo_poll pipe_poll | ||
427 | |||
428 | static int | 433 | static int |
429 | pipe_release(struct inode *inode, int decr, int decw) | 434 | pipe_release(struct inode *inode, int decr, int decw) |
430 | { | 435 | { |
@@ -568,7 +573,7 @@ struct file_operations read_fifo_fops = { | |||
568 | .read = pipe_read, | 573 | .read = pipe_read, |
569 | .readv = pipe_readv, | 574 | .readv = pipe_readv, |
570 | .write = bad_pipe_w, | 575 | .write = bad_pipe_w, |
571 | .poll = fifo_poll, | 576 | .poll = pipe_poll, |
572 | .ioctl = pipe_ioctl, | 577 | .ioctl = pipe_ioctl, |
573 | .open = pipe_read_open, | 578 | .open = pipe_read_open, |
574 | .release = pipe_read_release, | 579 | .release = pipe_read_release, |
@@ -580,7 +585,7 @@ struct file_operations write_fifo_fops = { | |||
580 | .read = bad_pipe_r, | 585 | .read = bad_pipe_r, |
581 | .write = pipe_write, | 586 | .write = pipe_write, |
582 | .writev = pipe_writev, | 587 | .writev = pipe_writev, |
583 | .poll = fifo_poll, | 588 | .poll = pipe_poll, |
584 | .ioctl = pipe_ioctl, | 589 | .ioctl = pipe_ioctl, |
585 | .open = pipe_write_open, | 590 | .open = pipe_write_open, |
586 | .release = pipe_write_release, | 591 | .release = pipe_write_release, |
@@ -593,7 +598,7 @@ struct file_operations rdwr_fifo_fops = { | |||
593 | .readv = pipe_readv, | 598 | .readv = pipe_readv, |
594 | .write = pipe_write, | 599 | .write = pipe_write, |
595 | .writev = pipe_writev, | 600 | .writev = pipe_writev, |
596 | .poll = fifo_poll, | 601 | .poll = pipe_poll, |
597 | .ioctl = pipe_ioctl, | 602 | .ioctl = pipe_ioctl, |
598 | .open = pipe_rdwr_open, | 603 | .open = pipe_rdwr_open, |
599 | .release = pipe_rdwr_release, | 604 | .release = pipe_rdwr_release, |