X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fsplice.c;h=4ee49e86edde5a2272781b6e49e0371b721ceb33;hb=3d4d4582e5b3f67a68f2cf32fd5b70d8d80f119d;hp=0a0b79b01d059a1c71b632de1807100578be8269;hpb=0ba6c33bcddc64a54b5f1c25a696c4767dc76292;p=linux-2.6 diff --git a/fs/splice.c b/fs/splice.c index 0a0b79b01d..4ee49e86ed 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1031,7 +1031,9 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, goto out_release; } +done: pipe->nrbufs = pipe->curbuf = 0; + file_accessed(in); return bytes; out_release: @@ -1047,16 +1049,11 @@ out_release: 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);