aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-08-11 09:49:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-23 05:13:01 -0400
commit440037287c5ebb07033ab927ca16bb68c291d309 (patch)
treec4be3843ea87a777c2647f471895917005d8068f /fs/ntfs
parent4ea3ada2955e4519befa98ff55dd62d6dfbd1705 (diff)
[PATCH] switch all filesystems over to d_obtain_alias
Switch all users of d_alloc_anon to d_obtain_alias. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ntfs')
-rw-r--r--fs/ntfs/namei.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 9e8a95be7a1e..2ca00153b6ec 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -304,8 +304,6 @@ static struct dentry *ntfs_get_parent(struct dentry *child_dent)
304 ntfs_attr_search_ctx *ctx; 304 ntfs_attr_search_ctx *ctx;
305 ATTR_RECORD *attr; 305 ATTR_RECORD *attr;
306 FILE_NAME_ATTR *fn; 306 FILE_NAME_ATTR *fn;
307 struct inode *parent_vi;
308 struct dentry *parent_dent;
309 unsigned long parent_ino; 307 unsigned long parent_ino;
310 int err; 308 int err;
311 309
@@ -345,24 +343,8 @@ try_next:
345 /* Release the search context and the mft record of the child. */ 343 /* Release the search context and the mft record of the child. */
346 ntfs_attr_put_search_ctx(ctx); 344 ntfs_attr_put_search_ctx(ctx);
347 unmap_mft_record(ni); 345 unmap_mft_record(ni);
348 /* Get the inode of the parent directory. */ 346
349 parent_vi = ntfs_iget(vi->i_sb, parent_ino); 347 return d_obtain_alias(ntfs_iget(vi->i_sb, parent_ino));
350 if (IS_ERR(parent_vi) || unlikely(is_bad_inode(parent_vi))) {
351 if (!IS_ERR(parent_vi))
352 iput(parent_vi);
353 ntfs_error(vi->i_sb, "Failed to get parent directory inode "
354 "0x%lx of child inode 0x%lx.", parent_ino,
355 vi->i_ino);
356 return ERR_PTR(-EACCES);
357 }
358 /* Finally get a dentry for the parent directory and return it. */
359 parent_dent = d_alloc_anon(parent_vi);
360 if (unlikely(!parent_dent)) {
361 iput(parent_vi);
362 return ERR_PTR(-ENOMEM);
363 }
364 ntfs_debug("Done for inode 0x%lx.", vi->i_ino);
365 return parent_dent;
366} 348}
367 349
368static struct inode *ntfs_nfs_get_inode(struct super_block *sb, 350static struct inode *ntfs_nfs_get_inode(struct super_block *sb,