* [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary.
@ 2009-06-19 7:36 Tao Ma
2009-06-19 20:25 ` Sunil Mushran
2009-06-19 23:32 ` Joel Becker
0 siblings, 2 replies; 3+ messages in thread
From: Tao Ma @ 2009-06-19 7:36 UTC (permalink / raw)
To: ocfs2-devel
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>
---
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 775ac34..95cba48 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2025,7 +2025,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
size_t len,
unsigned int flags)
{
- int ret = 0;
+ int ret = 0, lock_level = 0;
struct inode *inode = in->f_path.dentry->d_inode;
mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", in, pipe,
@@ -2036,12 +2036,12 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
/*
* See the comment in ocfs2_file_aio_read()
*/
- ret = ocfs2_inode_lock(inode, NULL, 0);
+ ret = ocfs2_inode_lock_atime(inode, in->f_vfsmnt, &lock_level);
if (ret < 0) {
mlog_errno(ret);
goto bail;
}
- ocfs2_inode_unlock(inode, 0);
+ ocfs2_inode_unlock(inode, lock_level);
ret = generic_file_splice_read(in, ppos, pipe, len, flags);
--
1.6.2.rc2.16.gf474c
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary.
2009-06-19 7:36 [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary Tao Ma
@ 2009-06-19 20:25 ` Sunil Mushran
2009-06-19 23:32 ` Joel Becker
1 sibling, 0 replies; 3+ messages in thread
From: Sunil Mushran @ 2009-06-19 20:25 UTC (permalink / raw)
To: ocfs2-devel
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Tao Ma wrote:
> 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>
> ---
> 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 775ac34..95cba48 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -2025,7 +2025,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
> size_t len,
> unsigned int flags)
> {
> - int ret = 0;
> + int ret = 0, lock_level = 0;
> struct inode *inode = in->f_path.dentry->d_inode;
>
> mlog_entry("(0x%p, 0x%p, %u, '%.*s')\n", in, pipe,
> @@ -2036,12 +2036,12 @@ static ssize_t ocfs2_file_splice_read(struct file *in,
> /*
> * See the comment in ocfs2_file_aio_read()
> */
> - ret = ocfs2_inode_lock(inode, NULL, 0);
> + ret = ocfs2_inode_lock_atime(inode, in->f_vfsmnt, &lock_level);
> if (ret < 0) {
> mlog_errno(ret);
> goto bail;
> }
> - ocfs2_inode_unlock(inode, 0);
> + ocfs2_inode_unlock(inode, lock_level);
>
> ret = generic_file_splice_read(in, ppos, pipe, len, flags);
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary.
2009-06-19 7:36 [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary Tao Ma
2009-06-19 20:25 ` Sunil Mushran
@ 2009-06-19 23:32 ` Joel Becker
1 sibling, 0 replies; 3+ messages in thread
From: Joel Becker @ 2009-06-19 23:32 UTC (permalink / raw)
To: ocfs2-devel
On Fri, Jun 19, 2009 at 03:36:52PM +0800, Tao Ma wrote:
> 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>
This is now in the fixes branch of ocfs2.git.
Joel
--
"Heav'n hath no rage like love to hatred turn'd, nor Hell a fury,
like a woman scorn'd."
- William Congreve
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-19 23:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 7:36 [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary Tao Ma
2009-06-19 20:25 ` Sunil Mushran
2009-06-19 23:32 ` Joel Becker
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.