diff options
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index ef4d04647325..398e5328b309 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) @@ -1202,12 +1203,7 @@ retry_lookup: err = -ENOMEM; goto done; } - err = ceph_init_dentry(dn); - if (err < 0) { - dput(dn); - dput(parent); - goto done; - } + err = 0; } else if (d_really_is_positive(dn) && (ceph_ino(d_inode(dn)) != vino.ino || ceph_snap(d_inode(dn)) != vino.snap)) { @@ -1561,12 +1557,6 @@ retry_lookup: err = -ENOMEM; goto out; } - ret = ceph_init_dentry(dn); - if (ret < 0) { - dput(dn); - err = ret; - goto out; - } } else if (d_really_is_positive(dn) && (ceph_ino(d_inode(dn)) != vino.ino || ceph_snap(d_inode(dn)) != vino.snap)) { @@ -1879,7 +1869,6 @@ retry: * symlinks */ static const struct inode_operations ceph_symlink_iops = { - .readlink = generic_readlink, .get_link = simple_get_link, .setattr = ceph_setattr, .getattr = ceph_getattr, |