diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_export.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 24fd598af846..7f7abec25e14 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c | |||
@@ -148,7 +148,6 @@ xfs_fs_fh_to_dentry(struct super_block *sb, struct fid *fid, | |||
148 | { | 148 | { |
149 | struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fid; | 149 | struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fid; |
150 | struct inode *inode = NULL; | 150 | struct inode *inode = NULL; |
151 | struct dentry *result; | ||
152 | 151 | ||
153 | if (fh_len < xfs_fileid_length(fileid_type)) | 152 | if (fh_len < xfs_fileid_length(fileid_type)) |
154 | return NULL; | 153 | return NULL; |
@@ -164,16 +163,7 @@ xfs_fs_fh_to_dentry(struct super_block *sb, struct fid *fid, | |||
164 | break; | 163 | break; |
165 | } | 164 | } |
166 | 165 | ||
167 | if (!inode) | 166 | return d_obtain_alias(inode); |
168 | return NULL; | ||
169 | if (IS_ERR(inode)) | ||
170 | return ERR_CAST(inode); | ||
171 | result = d_alloc_anon(inode); | ||
172 | if (!result) { | ||
173 | iput(inode); | ||
174 | return ERR_PTR(-ENOMEM); | ||
175 | } | ||
176 | return result; | ||
177 | } | 167 | } |
178 | 168 | ||
179 | STATIC struct dentry * | 169 | STATIC struct dentry * |
@@ -182,7 +172,6 @@ xfs_fs_fh_to_parent(struct super_block *sb, struct fid *fid, | |||
182 | { | 172 | { |
183 | struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fid; | 173 | struct xfs_fid64 *fid64 = (struct xfs_fid64 *)fid; |
184 | struct inode *inode = NULL; | 174 | struct inode *inode = NULL; |
185 | struct dentry *result; | ||
186 | 175 | ||
187 | switch (fileid_type) { | 176 | switch (fileid_type) { |
188 | case FILEID_INO32_GEN_PARENT: | 177 | case FILEID_INO32_GEN_PARENT: |
@@ -195,16 +184,7 @@ xfs_fs_fh_to_parent(struct super_block *sb, struct fid *fid, | |||
195 | break; | 184 | break; |
196 | } | 185 | } |
197 | 186 | ||
198 | if (!inode) | 187 | return d_obtain_alias(inode); |
199 | return NULL; | ||
200 | if (IS_ERR(inode)) | ||
201 | return ERR_CAST(inode); | ||
202 | result = d_alloc_anon(inode); | ||
203 | if (!result) { | ||
204 | iput(inode); | ||
205 | return ERR_PTR(-ENOMEM); | ||
206 | } | ||
207 | return result; | ||
208 | } | 188 | } |
209 | 189 | ||
210 | STATIC struct dentry * | 190 | STATIC struct dentry * |
@@ -213,18 +193,12 @@ xfs_fs_get_parent( | |||
213 | { | 193 | { |
214 | int error; | 194 | int error; |
215 | struct xfs_inode *cip; | 195 | struct xfs_inode *cip; |
216 | struct dentry *parent; | ||
217 | 196 | ||
218 | error = xfs_lookup(XFS_I(child->d_inode), &xfs_name_dotdot, &cip, NULL); | 197 | error = xfs_lookup(XFS_I(child->d_inode), &xfs_name_dotdot, &cip, NULL); |
219 | if (unlikely(error)) | 198 | if (unlikely(error)) |
220 | return ERR_PTR(-error); | 199 | return ERR_PTR(-error); |
221 | 200 | ||
222 | parent = d_alloc_anon(VFS_I(cip)); | 201 | return d_obtain_alias(VFS_I(cip)); |
223 | if (unlikely(!parent)) { | ||
224 | iput(VFS_I(cip)); | ||
225 | return ERR_PTR(-ENOMEM); | ||
226 | } | ||
227 | return parent; | ||
228 | } | 202 | } |
229 | 203 | ||
230 | const struct export_operations xfs_export_operations = { | 204 | const struct export_operations xfs_export_operations = { |