summaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-04-02 23:05:41 +0200
committerJens Axboe <axboe@suse.de>2006-04-02 23:05:41 +0200
commitb2b39fa478db6db89b7ccafb0649973845b0eb75 (patch)
tree784d85b94fb634e3b33dfd3f1153c98580cfac15 /fs/splice.c
parent83f9135bddffded9f1716519b6c147bcf046c87e (diff)
downloadop-kernel-dev-b2b39fa478db6db89b7ccafb0649973845b0eb75.zip
op-kernel-dev-b2b39fa478db6db89b7ccafb0649973845b0eb75.tar.gz
[PATCH] splice: add a SPLICE_F_MORE flag
This lets userspace indicate whether more data will be coming in a subsequent splice call. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 3459192..e845445 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -354,6 +354,7 @@ static int pipe_to_sendpage(struct pipe_inode_info *info,
unsigned int offset;
ssize_t ret;
void *ptr;
+ int more;
/*
* sub-optimal, but we are limited by the pipe ->map. we don't
@@ -366,9 +367,9 @@ static int pipe_to_sendpage(struct pipe_inode_info *info,
return PTR_ERR(ptr);
offset = pos & ~PAGE_CACHE_MASK;
+ more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
- ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,
- sd->len < sd->total_len);
+ ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,more);
buf->ops->unmap(info, buf);
if (ret == sd->len)
OpenPOWER on IntegriCloud