From 18fc8abdb7537bf841a65ce06a33977c109acc92 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 28 Oct 2016 21:52:50 -0400 Subject: ceph: unify dentry_operations instances Signed-off-by: Al Viro --- fs/ceph/inode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'fs/ceph/inode.c') 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) -- cgit v1.2.3