aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r--fs/ceph/dir.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 00894ff9246c..f391f1e75414 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -51,8 +51,7 @@ int ceph_init_dentry(struct dentry *dentry)
51 goto out_unlock; 51 goto out_unlock;
52 } 52 }
53 53
54 if (dentry->d_parent == NULL || /* nfs fh_to_dentry */ 54 if (ceph_snap(dentry->d_parent->d_inode) == CEPH_NOSNAP)
55 ceph_snap(dentry->d_parent->d_inode) == CEPH_NOSNAP)
56 d_set_d_op(dentry, &ceph_dentry_ops); 55 d_set_d_op(dentry, &ceph_dentry_ops);
57 else if (ceph_snap(dentry->d_parent->d_inode) == CEPH_SNAPDIR) 56 else if (ceph_snap(dentry->d_parent->d_inode) == CEPH_SNAPDIR)
58 d_set_d_op(dentry, &ceph_snapdir_dentry_ops); 57 d_set_d_op(dentry, &ceph_snapdir_dentry_ops);
@@ -79,7 +78,7 @@ struct inode *ceph_get_dentry_parent_inode(struct dentry *dentry)
79 return NULL; 78 return NULL;
80 79
81 spin_lock(&dentry->d_lock); 80 spin_lock(&dentry->d_lock);
82 if (dentry->d_parent) { 81 if (!IS_ROOT(dentry)) {
83 inode = dentry->d_parent->d_inode; 82 inode = dentry->d_parent->d_inode;
84 ihold(inode); 83 ihold(inode);
85 } 84 }
@@ -1154,7 +1153,7 @@ static void ceph_d_prune(struct dentry *dentry)
1154 dout("ceph_d_prune %p\n", dentry); 1153 dout("ceph_d_prune %p\n", dentry);
1155 1154
1156 /* do we have a valid parent? */ 1155 /* do we have a valid parent? */
1157 if (!dentry->d_parent || IS_ROOT(dentry)) 1156 if (IS_ROOT(dentry))
1158 return; 1157 return;
1159 1158
1160 /* if we are not hashed, we don't affect D_COMPLETE */ 1159 /* if we are not hashed, we don't affect D_COMPLETE */