From patchwork Wed Jun 22 14:35:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9193119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73D3260756 for ; Wed, 22 Jun 2016 14:38:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64B4128358 for ; Wed, 22 Jun 2016 14:38:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58F602840B; Wed, 22 Jun 2016 14:38:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B2628358 for ; Wed, 22 Jun 2016 14:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752849AbcFVOhj (ORCPT ); Wed, 22 Jun 2016 10:37:39 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36779 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752443AbcFVOfS (ORCPT ); Wed, 22 Jun 2016 10:35:18 -0400 Received: by mail-wm0-f53.google.com with SMTP id f126so90497012wma.1 for ; Wed, 22 Jun 2016 07:35:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FvtspKxHIoAnFPsalmvZsraXptPq4G4sAfuwAwdElvk=; b=dTwxfs0kodaSxjbxtWobHdkKkgzWpxRsRZPTYDB84DrK8Q9OZRKYiWbGqsGTG8cJZa rzQcXyqp3NxizbaBDXC/Ngw7S4yCkZ/N5A/WlF8rS5F5E/02SLzuXtreOy5qjXqZdlmx zxYb/927th3NDQu19aFIf1CdV88MZ2lFjrtJgaexXclW8DQkFZBn842cwf4f2ef2ZXy/ XBXB2hcMM4vpr+VDN3FzoylvBGeRD1CRlPahmOU+SAlHQuRr1jcO0qe4NOZ+8FKpTqCU IO4eSWPhkcwEhsz8CPRBYkJKnHD/X7bXXxQjHHniuFjfyWeo0suXxvRtCt6jXg22UMZM 0HQA== X-Gm-Message-State: ALyK8tKPBJ8jwcFDZPWGqoJOQpnky6/NuFgqd/3dTnXHdcYBYyOCPZ09aOO1dsNulC0/fL5K X-Received: by 10.194.79.198 with SMTP id l6mr24943805wjx.27.1466606115462; Wed, 22 Jun 2016 07:35:15 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id u71sm930666wmu.13.2016.06.22.07.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 07:35:14 -0700 (PDT) From: Miklos Szeredi To: Al Viro Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Yan, Zheng" Subject: [PATCH 2/8] ceph: don't use ->d_time Date: Wed, 22 Jun 2016 16:35:04 +0200 Message-Id: <1466606110-24297-3-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466606110-24297-1-git-send-email-mszeredi@redhat.com> References: <1466606110-24297-1-git-send-email-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pretty simple: just use ceph_dentry_info.time instead (which was already there, unused). Signed-off-by: Miklos Szeredi Cc: Yan, Zheng Reviewed-by: Yan, Zheng --- 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(-) 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; };