summaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-10-29 03:52:50 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-10-29 03:52:50 +0200
commit18fc8abdb7537bf841a65ce06a33977c109acc92 (patch)
treecd5caca422dcc93090fe119121768fc888cb51fc /fs/ceph/inode.c
parentlustre: switch to use of ->d_init() (diff)
downloadlinux-18fc8abdb7537bf841a65ce06a33977c109acc92.tar.xz
linux-18fc8abdb7537bf841a65ce06a33977c109acc92.zip
ceph: unify dentry_operations instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index bca1b49c1c4b..29fcbee2d416 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1023,16 +1023,17 @@ static void update_dentry_lease(struct dentry *dentry,
long unsigned half_ttl = from_time + (duration * HZ / 2) / 1000;
struct inode *dir;
- /* only track leases on regular dentries */
- if (dentry->d_op != &ceph_dentry_ops)
- return;
-
spin_lock(&dentry->d_lock);
dout("update_dentry_lease %p duration %lu ms ttl %lu\n",
dentry, duration, ttl);
/* make lease_rdcache_gen match directory */
dir = d_inode(dentry->d_parent);
+
+ /* only track leases on regular dentries */
+ if (ceph_snap(dir) != CEPH_NOSNAP)
+ goto out_unlock;
+
di->lease_shared_gen = ceph_inode(dir)->i_shared_gen;
if (duration == 0)