aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-03-18 02:44:31 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-18 02:44:31 -0400
commit2f633928cbba8a5858bb39b11e7219a41b0fbef5 (patch)
tree9a82f4b7f2c3afe4b0208d8e44ea61bae90a7d22 /fs/splice.c
parent5e226e4d9016daee170699f8a4188a5505021756 (diff)
parentbde4f8fa8db2abd5ac9c542d76012d0fedab050f (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c12
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