diff options
author | Christoph Hellwig <hch@lst.de> | 2008-08-11 09:49:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 05:13:01 -0400 |
commit | 440037287c5ebb07033ab927ca16bb68c291d309 (patch) | |
tree | c4be3843ea87a777c2647f471895917005d8068f /fs/reiserfs | |
parent | 4ea3ada2955e4519befa98ff55dd62d6dfbd1705 (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/reiserfs')
-rw-r--r-- | fs/reiserfs/inode.c | 13 | ||||
-rw-r--r-- | fs/reiserfs/namei.c | 11 |
2 files changed, 3 insertions, 21 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 5699171212ae..6c4c2c69449f 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -1522,7 +1522,6 @@ static struct dentry *reiserfs_get_dentry(struct super_block *sb, | |||
1522 | 1522 | ||
1523 | { | 1523 | { |
1524 | struct cpu_key key; | 1524 | struct cpu_key key; |
1525 | struct dentry *result; | ||
1526 | struct inode *inode; | 1525 | struct inode *inode; |
1527 | 1526 | ||
1528 | key.on_disk_key.k_objectid = objectid; | 1527 | key.on_disk_key.k_objectid = objectid; |
@@ -1535,16 +1534,8 @@ static struct dentry *reiserfs_get_dentry(struct super_block *sb, | |||
1535 | inode = NULL; | 1534 | inode = NULL; |
1536 | } | 1535 | } |
1537 | reiserfs_write_unlock(sb); | 1536 | reiserfs_write_unlock(sb); |
1538 | if (!inode) | 1537 | |
1539 | inode = ERR_PTR(-ESTALE); | 1538 | return d_obtain_alias(inode); |
1540 | if (IS_ERR(inode)) | ||
1541 | return ERR_CAST(inode); | ||
1542 | result = d_alloc_anon(inode); | ||
1543 | if (!result) { | ||
1544 | iput(inode); | ||
1545 | return ERR_PTR(-ENOMEM); | ||
1546 | } | ||
1547 | return result; | ||
1548 | } | 1539 | } |
1549 | 1540 | ||
1550 | struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid, | 1541 | struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid, |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index c1add28dd45e..f89ebb943f3f 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -383,7 +383,6 @@ struct dentry *reiserfs_get_parent(struct dentry *child) | |||
383 | struct inode *inode = NULL; | 383 | struct inode *inode = NULL; |
384 | struct reiserfs_dir_entry de; | 384 | struct reiserfs_dir_entry de; |
385 | INITIALIZE_PATH(path_to_entry); | 385 | INITIALIZE_PATH(path_to_entry); |
386 | struct dentry *parent; | ||
387 | struct inode *dir = child->d_inode; | 386 | struct inode *dir = child->d_inode; |
388 | 387 | ||
389 | if (dir->i_nlink == 0) { | 388 | if (dir->i_nlink == 0) { |
@@ -401,15 +400,7 @@ struct dentry *reiserfs_get_parent(struct dentry *child) | |||
401 | inode = reiserfs_iget(dir->i_sb, (struct cpu_key *)&(de.de_dir_id)); | 400 | inode = reiserfs_iget(dir->i_sb, (struct cpu_key *)&(de.de_dir_id)); |
402 | reiserfs_write_unlock(dir->i_sb); | 401 | reiserfs_write_unlock(dir->i_sb); |
403 | 402 | ||
404 | if (!inode || IS_ERR(inode)) { | 403 | return d_obtain_alias(inode); |
405 | return ERR_PTR(-EACCES); | ||
406 | } | ||
407 | parent = d_alloc_anon(inode); | ||
408 | if (!parent) { | ||
409 | iput(inode); | ||
410 | parent = ERR_PTR(-ENOMEM); | ||
411 | } | ||
412 | return parent; | ||
413 | } | 404 | } |
414 | 405 | ||
415 | /* add entry to the directory (entry can be hidden). | 406 | /* add entry to the directory (entry can be hidden). |