• Linus Torvalds's avatar
    pipe: simplify signal handling in pipe_read() and add comments · d1c6a2aa
    Linus Torvalds authored
    There's no need to separately check for signals while inside the locked
    region, since we're going to do "wait_event_interruptible()" right
    afterwards anyway, and the error handling is much simpler there.
    
    The check for whether we had already read anything was also redundant,
    since we no longer do the odd merging of reads when there are pending
    writers.
    
    But perhaps more importantly, this adds commentary about why we still
    need to wake up possible writers even though we didn't read any data,
    and why we can skip all the finishing touches now if we get a signal (or
    had a signal pending) while waiting for more data.
    
    [ This is a split-out cleanup from my "make pipe IO use exclusive wait
      queues" thing, which I can't apply because it triggers a nasty bug in
      the GNU make jobserver   - Linus ]
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d1c6a2aa
pipe.c 31.6 KB