diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-04 11:08:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-04 11:08:05 -0500 |
commit | ce932967b9f77c130d4936d1e20d619a628ae08f (patch) | |
tree | af0274e83664d9563468f0647b178427d3b18560 /fs/splice.c | |
parent | 8727e28ddebb031d80b5e261c98c24f1dcb9a82f (diff) | |
parent | cc66b4512cae8df4ed1635483210aabf7690ec27 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: fix blkdev_issue_flush() not detecting and passing EOPNOTSUPP back
block: fix shadowed variable warning in blk-map.c
block: remove extern on function definition
cciss: remove READ_AHEAD define and use block layer defaults
make cdrom.c:check_for_audio_disc() static
block/genhd.c: proper externs
unexport blk_rq_map_user_iov
unexport blk_{get,put}_queue
block/genhd.c: cleanups
proper prototype for blk_dev_init()
block/blk-tag.c should #include "blk.h"
Fix DMA access of block device in 64-bit kernel on some non-x86 systems with 4GB or upper 4GB memory
block: separate out padding from alignment
block: restore the meaning of rq->data_len to the true data length
resubmit: cciss: procfs updates to display info about many
splice: only return -EAGAIN if there's hope of more data
block: fix kernel-docbook parameters and files
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/splice.c b/fs/splice.c index 9b559ee711a8..0670c915cd35 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1669,6 +1669,13 @@ static int link_pipe(struct pipe_inode_info *ipipe, | |||
1669 | i++; | 1669 | i++; |
1670 | } while (len); | 1670 | } while (len); |
1671 | 1671 | ||
1672 | /* | ||
1673 | * return EAGAIN if we have the potential of some data in the | ||
1674 | * future, otherwise just return 0 | ||
1675 | */ | ||
1676 | if (!ret && ipipe->waiting_writers && (flags & SPLICE_F_NONBLOCK)) | ||
1677 | ret = -EAGAIN; | ||
1678 | |||
1672 | inode_double_unlock(ipipe->inode, opipe->inode); | 1679 | inode_double_unlock(ipipe->inode, opipe->inode); |
1673 | 1680 | ||
1674 | /* | 1681 | /* |
@@ -1709,11 +1716,8 @@ static long do_tee(struct file *in, struct file *out, size_t len, | |||
1709 | ret = link_ipipe_prep(ipipe, flags); | 1716 | ret = link_ipipe_prep(ipipe, flags); |
1710 | if (!ret) { | 1717 | if (!ret) { |
1711 | ret = link_opipe_prep(opipe, flags); | 1718 | ret = link_opipe_prep(opipe, flags); |
1712 | if (!ret) { | 1719 | if (!ret) |
1713 | ret = link_pipe(ipipe, opipe, len, flags); | 1720 | ret = link_pipe(ipipe, opipe, len, flags); |
1714 | if (!ret && (flags & SPLICE_F_NONBLOCK)) | ||
1715 | ret = -EAGAIN; | ||
1716 | } | ||
1717 | } | 1721 | } |
1718 | } | 1722 | } |
1719 | 1723 | ||