aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/export.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/export.c')
-rw-r--r--fs/ceph/export.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 6e72c98162d5..1780218a48f0 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -95,10 +95,8 @@ static struct dentry *__fh_to_dentry(struct super_block *sb, u64 ino)
95 } 95 }
96 96
97 dentry = d_obtain_alias(inode); 97 dentry = d_obtain_alias(inode);
98 if (IS_ERR(dentry)) { 98 if (IS_ERR(dentry))
99 iput(inode);
100 return dentry; 99 return dentry;
101 }
102 err = ceph_init_dentry(dentry); 100 err = ceph_init_dentry(dentry);
103 if (err < 0) { 101 if (err < 0) {
104 dput(dentry); 102 dput(dentry);
@@ -167,10 +165,8 @@ static struct dentry *__get_parent(struct super_block *sb,
167 return ERR_PTR(-ENOENT); 165 return ERR_PTR(-ENOENT);
168 166
169 dentry = d_obtain_alias(inode); 167 dentry = d_obtain_alias(inode);
170 if (IS_ERR(dentry)) { 168 if (IS_ERR(dentry))
171 iput(inode);
172 return dentry; 169 return dentry;
173 }
174 err = ceph_init_dentry(dentry); 170 err = ceph_init_dentry(dentry);
175 if (err < 0) { 171 if (err < 0) {
176 dput(dentry); 172 dput(dentry);
@@ -210,7 +206,7 @@ static struct dentry *ceph_fh_to_parent(struct super_block *sb,
210 206
211 dout("fh_to_parent %llx\n", cfh->parent_ino); 207 dout("fh_to_parent %llx\n", cfh->parent_ino);
212 dentry = __get_parent(sb, NULL, cfh->ino); 208 dentry = __get_parent(sb, NULL, cfh->ino);
213 if (IS_ERR(dentry) && PTR_ERR(dentry) == -ENOENT) 209 if (unlikely(dentry == ERR_PTR(-ENOENT)))
214 dentry = __fh_to_dentry(sb, cfh->parent_ino); 210 dentry = __fh_to_dentry(sb, cfh->parent_ino);
215 return dentry; 211 return dentry;
216} 212}