diff options
author | Jeff Layton <jlayton@kernel.org> | 2021-06-04 12:03:09 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-06-29 00:15:52 +0200 |
commit | 52d60f8e18b855d67ecdc4fa34ae1b894d36c7b9 (patch) | |
tree | 5cd52b763fe50a2fafbf775519803e029ee6bb2b /fs/ceph/inode.c | |
parent | 7e65624d32b6e0429b1d3559e5585657f34f74a1 (diff) |
ceph: eliminate session->s_gen_ttl_lock
Turn s_cap_gen field into an atomic_t, and just rely on the fact that we
hold the s_mutex when changing the s_cap_ttl field.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 6f43542b3344..6034821c9d63 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1124,7 +1124,7 @@ static void __update_dentry_lease(struct inode *dir, struct dentry *dentry, return; } - if (di->lease_gen == session->s_cap_gen && + if (di->lease_gen == atomic_read(&session->s_cap_gen) && time_before(ttl, di->time)) return; /* we already have a newer lease. */ @@ -1135,7 +1135,7 @@ static void __update_dentry_lease(struct inode *dir, struct dentry *dentry, if (!di->lease_session) di->lease_session = ceph_get_mds_session(session); - di->lease_gen = session->s_cap_gen; + di->lease_gen = atomic_read(&session->s_cap_gen); di->lease_seq = le32_to_cpu(lease->seq); di->lease_renew_after = half_ttl; di->lease_renew_from = 0; |