All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: Update atime in splice read if necessary.
Date: Fri, 19 Jun 2009 13:25:53 -0700	[thread overview]
Message-ID: <4A3BF451.10000@oracle.com> (raw)
In-Reply-To: <1245397012-20648-1-git-send-email-tao.ma@oracle.com>

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);
>  
>   

  reply	other threads:[~2009-06-19 20:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-06-19 23:32 ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A3BF451.10000@oracle.com \
    --to=sunil.mushran@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.