diff options
author | Tao Ma <tao.ma@oracle.com> | 2009-06-19 03:36:52 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-06-22 17:24:45 -0400 |
commit | 1962f39abbb2d5643a7d59169422661a2d58793d (patch) | |
tree | a6d5f0566e10d9fd1417d9deda78ebe83b067ca2 /fs/ocfs2/file.c | |
parent | 1c520dfbf391e1617ef61553f815b8006a066c44 (diff) |
ocfs2: Update atime in splice read if necessary.
We should call ocfs2_inode_lock_atime instead of ocfs2_inode_lock
in ocfs2_file_splice_read like we do in ocfs2_file_aio_read so
that we can update atime in splice read if necessary.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 07267e0da909..62442e413a00 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -2026,7 +2026,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in, | |||
2026 | size_t len, | 2026 | size_t len, |
2027 | unsigned int flags) | 2027 | unsigned int flags) |
2028 | { | 2028 | { |
2029 | int ret = 0; | 2029 | int ret = 0, lock_level = 0; |
2030 | struct inode *inode = in->f_path.dentry->d_inode; | 2030 | struct inode *inode = in->f_path.dentry->d_inode; |
2031 | 2031 | ||
2032 | mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", in, pipe, | 2032 | mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", in, pipe, |
@@ -2037,12 +2037,12 @@ static ssize_t ocfs2_file_splice_read(struct file *in, | |||
2037 | /* | 2037 | /* |
2038 | * See the comment in ocfs2_file_aio_read() | 2038 | * See the comment in ocfs2_file_aio_read() |
2039 | */ | 2039 | */ |
2040 | ret = ocfs2_inode_lock(inode, NULL, 0); | 2040 | ret = ocfs2_inode_lock_atime(inode, in->f_vfsmnt, &lock_level); |
2041 | if (ret < 0) { | 2041 | if (ret < 0) { |
2042 | mlog_errno(ret); | 2042 | mlog_errno(ret); |
2043 | goto bail; | 2043 | goto bail; |
2044 | } | 2044 | } |
2045 | ocfs2_inode_unlock(inode, 0); | 2045 | ocfs2_inode_unlock(inode, lock_level); |
2046 | 2046 | ||
2047 | ret = generic_file_splice_read(in, ppos, pipe, len, flags); | 2047 | ret = generic_file_splice_read(in, ppos, pipe, len, flags); |
2048 | 2048 | ||