summaryrefslogtreecommitdiffstats
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-02-21 15:01:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-02-21 15:01:38 -0800
commit8bd89ca22010847e85de37b77d9f19f16b1962ad (patch)
tree0bcee2ae6a85443177a6d95ed960301e0f4c9d57 /fs/ceph/dir.c
parentb08b69a110bd981909c248f89997dcdcdfd5a39c (diff)
parent97d79b403ef03f729883246208ef5d8a2ebc4d68 (diff)
downloadop-kernel-dev-8bd89ca22010847e85de37b77d9f19f16b1962ad.zip
op-kernel-dev-8bd89ca22010847e85de37b77d9f19f16b1962ad.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: ceph: keep reference to parent inode on ceph_dentry ceph: queue cap_snaps once per realm libceph: fix socket write error handling libceph: fix socket read error handling
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 0bc68de..f0aef78 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -60,6 +60,7 @@ int ceph_init_dentry(struct dentry *dentry)
}
di->dentry = dentry;
di->lease_session = NULL;
+ di->parent_inode = igrab(dentry->d_parent->d_inode);
dentry->d_fsdata = di;
dentry->d_time = jiffies;
ceph_dentry_lru_add(dentry);
@@ -1033,7 +1034,7 @@ static void ceph_dentry_release(struct dentry *dentry)
u64 snapid = CEPH_NOSNAP;
if (!IS_ROOT(dentry)) {
- parent_inode = dentry->d_parent->d_inode;
+ parent_inode = di->parent_inode;
if (parent_inode)
snapid = ceph_snap(parent_inode);
}
@@ -1058,6 +1059,8 @@ static void ceph_dentry_release(struct dentry *dentry)
kmem_cache_free(ceph_dentry_cachep, di);
dentry->d_fsdata = NULL;
}
+ if (parent_inode)
+ iput(parent_inode);
}
static int ceph_snapdir_d_revalidate(struct dentry *dentry,
OpenPOWER on IntegriCloud