From ccc468ba590ad0850d9c5b1d55b678dccbae9ed5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 29 Jan 2008 21:05:57 +0100 Subject: [PATCH] --- yaml --- r: 79562 b: refs/heads/master c: 9e97198dbf318be7958b57900d05b37c7e09ad7c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/splice.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index e0f29454e291..985349d20c4b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 12f32bb31772e72d8cf52a29f961561bccc54c37 +refs/heads/master: 9e97198dbf318be7958b57900d05b37c7e09ad7c diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 0a0b79b01d05..1577a7391d23 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -1031,7 +1031,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, goto out_release; } +done: pipe->nrbufs = pipe->curbuf = 0; + if (bytes > 0) + file_accessed(in); + return bytes; out_release: @@ -1047,16 +1051,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, buf->ops = NULL; } } - pipe->nrbufs = pipe->curbuf = 0; - - /* - * If we transferred some data, return the number of bytes: - */ - if (bytes > 0) - return bytes; - return ret; + if (!bytes) + bytes = ret; + goto done; } EXPORT_SYMBOL(splice_direct_to_actor);