linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yan, Zheng" <zyan@redhat.com>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/8] ceph: don't use ->d_time
Date: Thu, 23 Jun 2016 14:21:04 +0800	[thread overview]
Message-ID: <D9A8C16E-B6ED-4EC4-8834-1080F0DFF93F@redhat.com> (raw)
In-Reply-To: <1466606110-24297-3-git-send-email-mszeredi@redhat.com>


> On Jun 22, 2016, at 22:35, Miklos Szeredi <mszeredi@redhat.com> wrote:
> 
> Pretty simple: just use ceph_dentry_info.time instead (which was already
> there, unused).
> 
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Cc: Yan, Zheng <zyan@redhat.com>
> ---
> fs/ceph/dir.c        | 6 +++---
> fs/ceph/inode.c      | 4 ++--
> fs/ceph/mds_client.c | 4 ++--
> fs/ceph/super.h      | 2 +-
> 4 files changed, 8 insertions(+), 8 deletions(-)

Reviewed-by: Yan, Zheng <zyan@redhat.com>

> 
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index 6e0fedf6713b..8ff7bcc7fc88 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -59,7 +59,7 @@ int ceph_init_dentry(struct dentry *dentry)
> 
> 	di->dentry = dentry;
> 	di->lease_session = NULL;
> -	dentry->d_time = jiffies;
> +	di->time = jiffies;
> 	/* avoid reordering d_fsdata setup so that the check above is safe */
> 	smp_mb();
> 	dentry->d_fsdata = di;
> @@ -1124,7 +1124,7 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
> void ceph_invalidate_dentry_lease(struct dentry *dentry)
> {
> 	spin_lock(&dentry->d_lock);
> -	dentry->d_time = jiffies;
> +	ceph_dentry(dentry)->time = jiffies;
> 	ceph_dentry(dentry)->lease_shared_gen = 0;
> 	spin_unlock(&dentry->d_lock);
> }
> @@ -1154,7 +1154,7 @@ static int dentry_lease_is_valid(struct dentry *dentry)
> 		spin_unlock(&s->s_gen_ttl_lock);
> 
> 		if (di->lease_gen == gen &&
> -		    time_before(jiffies, dentry->d_time) &&
> +		    time_before(jiffies, di->time) &&
> 		    time_before(jiffies, ttl)) {
> 			valid = 1;
> 			if (di->lease_renew_after &&
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index f059b5997072..7a33178ef850 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -1018,7 +1018,7 @@ static void update_dentry_lease(struct dentry *dentry,
> 		goto out_unlock;
> 
> 	if (di->lease_gen == session->s_cap_gen &&
> -	    time_before(ttl, dentry->d_time))
> +	    time_before(ttl, di->time))
> 		goto out_unlock;  /* we already have a newer lease. */
> 
> 	if (di->lease_session && di->lease_session != session)
> @@ -1032,7 +1032,7 @@ static void update_dentry_lease(struct dentry *dentry,
> 	di->lease_seq = le32_to_cpu(lease->seq);
> 	di->lease_renew_after = half_ttl;
> 	di->lease_renew_from = 0;
> -	dentry->d_time = ttl;
> +	di->time = ttl;
> out_unlock:
> 	spin_unlock(&dentry->d_lock);
> 	return;
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 2103b823bec0..db9c654d42cd 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -3231,7 +3231,7 @@ static void handle_lease(struct ceph_mds_client *mdsc,
> 				msecs_to_jiffies(le32_to_cpu(h->duration_ms));
> 
> 			di->lease_seq = seq;
> -			dentry->d_time = di->lease_renew_from + duration;
> +			di->time = di->lease_renew_from + duration;
> 			di->lease_renew_after = di->lease_renew_from +
> 				(duration >> 1);
> 			di->lease_renew_from = 0;
> @@ -3316,7 +3316,7 @@ void ceph_mdsc_lease_release(struct ceph_mds_client *mdsc, struct inode *inode,
> 	if (!di || !di->lease_session ||
> 	    di->lease_session->s_mds < 0 ||
> 	    di->lease_gen != di->lease_session->s_cap_gen ||
> -	    !time_before(jiffies, dentry->d_time)) {
> +	    !time_before(jiffies, di->time)) {
> 		dout("lease_release inode %p dentry %p -- "
> 		     "no lease\n",
> 		     inode, dentry);
> diff --git a/fs/ceph/super.h b/fs/ceph/super.h
> index 0168b49fb6ad..10776db93143 100644
> --- a/fs/ceph/super.h
> +++ b/fs/ceph/super.h
> @@ -246,7 +246,7 @@ struct ceph_dentry_info {
> 	unsigned long lease_renew_after, lease_renew_from;
> 	struct list_head lru;
> 	struct dentry *dentry;
> -	u64 time;
> +	unsigned long time;
> 	u64 offset;
> };
> 
> -- 
> 2.5.5
> 

  reply	other threads:[~2016-06-23  6:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 14:35 [PATCH 0/8] remove d_time from dentry Miklos Szeredi
2016-06-22 14:35 ` [PATCH 1/8] vfs: new d_allocate method Miklos Szeredi
2016-06-22 17:02   ` Al Viro
2016-06-22 20:33     ` Miklos Szeredi
2016-06-22 14:35 ` [PATCH 2/8] ceph: don't use ->d_time Miklos Szeredi
2016-06-23  6:21   ` Yan, Zheng [this message]
2016-06-28  8:09     ` Miklos Szeredi
2016-06-28  8:39       ` Yan, Zheng
2016-06-22 14:35 ` [PATCH 3/8] cifs: " Miklos Szeredi
2016-06-22 14:35 ` [PATCH 4/8] vfat: " Miklos Szeredi
2016-06-22 14:35 ` [PATCH 5/8] fuse: " Miklos Szeredi
2016-06-22 16:46   ` Al Viro
2016-06-22 14:35 ` [PATCH 6/8] nfs: " Miklos Szeredi
2016-06-22 16:48   ` Al Viro
2016-06-22 14:35 ` [PATCH 7/8] ncpfs: " Miklos Szeredi
2016-06-22 16:52   ` Al Viro
2016-06-22 14:35 ` [PATCH 8/8] vfs: remove ->d_time Miklos Szeredi
2016-06-22 21:21 ` [PATCH 0/8] remove d_time from dentry Miklos Szeredi

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=D9A8C16E-B6ED-4EC4-8834-1080F0DFF93F@redhat.com \
    --to=zyan@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).