diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-01-29 15:05:57 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-01-29 15:55:20 -0500 |
commit | 9e97198dbf318be7958b57900d05b37c7e09ad7c (patch) | |
tree | f74fdf942c1b4c09c59d7f2b8ac4a48e8a471a71 | |
parent | 12f32bb31772e72d8cf52a29f961561bccc54c37 (diff) |
splice: fix problem with atime not being updated
A bug report on nfsd that states that since it was switched to use
splice instead of sendfile, the atime was no longer being updated
on the input file. do_generic_mapping_read() does this when accessing
the file, make splice do it for the direct splice handler.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | fs/splice.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/splice.c b/fs/splice.c index 0a0b79b01d05..1577a7391d23 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1031,7 +1031,11 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, | |||
1031 | goto out_release; | 1031 | goto out_release; |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | done: | ||
1034 | pipe->nrbufs = pipe->curbuf = 0; | 1035 | pipe->nrbufs = pipe->curbuf = 0; |
1036 | if (bytes > 0) | ||
1037 | file_accessed(in); | ||
1038 | |||
1035 | return bytes; | 1039 | return bytes; |
1036 | 1040 | ||
1037 | out_release: | 1041 | out_release: |
@@ -1047,16 +1051,11 @@ out_release: | |||
1047 | buf->ops = NULL; | 1051 | buf->ops = NULL; |
1048 | } | 1052 | } |
1049 | } | 1053 | } |
1050 | pipe->nrbufs = pipe->curbuf = 0; | ||
1051 | |||
1052 | /* | ||
1053 | * If we transferred some data, return the number of bytes: | ||
1054 | */ | ||
1055 | if (bytes > 0) | ||
1056 | return bytes; | ||
1057 | 1054 | ||
1058 | return ret; | 1055 | if (!bytes) |
1056 | bytes = ret; | ||
1059 | 1057 | ||
1058 | goto done; | ||
1060 | } | 1059 | } |
1061 | EXPORT_SYMBOL(splice_direct_to_actor); | 1060 | EXPORT_SYMBOL(splice_direct_to_actor); |
1062 | 1061 | ||