aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:22:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:22:40 -0400
commit5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47 (patch)
treeaf19ed28db83e8f52690872ac99336da1cf2fd3b /fs/ocfs2
parent5b34653963de7a6d0d8c783527457d68fddc60fb (diff)
parentfd217f4d70172c526478f2bc76859e909fdfa674 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (46 commits) [PATCH] fs: add a sanity check in d_free [PATCH] i_version: remount support [patch] vfs: make security_inode_setattr() calling consistent [patch 1/3] FS_MBCACHE: don't needlessly make it built-in [PATCH] move executable checking into ->permission() [PATCH] fs/dcache.c: update comment of d_validate() [RFC PATCH] touch_mnt_namespace when the mount flags change [PATCH] reiserfs: add missing llseek method [PATCH] fix ->llseek for more directories [PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent [PATCH vfs-2.6 5/6] vfs: remove LOOKUP_PARENT from non LOOKUP_PARENT lookup [PATCH vfs-2.6 4/6] vfs: remove unnecessary fsnotify_d_instantiate() [PATCH vfs-2.6 3/6] vfs: add __d_instantiate() helper [PATCH vfs-2.6 2/6] vfs: add d_ancestor() [PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT() [PATCH] get rid of on-stack dentry in udf [PATCH 2/2] anondev: switch to IDA [PATCH 1/2] anondev: init IDR statically [JFFS2] Use d_splice_alias() not d_add() in jffs2_lookup() [PATCH] Optimise NFS readdir hack slightly. ...
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/export.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index 67527cebf214..2f27b332d8b3 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -68,14 +68,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
68 return ERR_PTR(-ESTALE); 68 return ERR_PTR(-ESTALE);
69 } 69 }
70 70
71 result = d_alloc_anon(inode); 71 result = d_obtain_alias(inode);
72 72 if (!IS_ERR(result))
73 if (!result) { 73 result->d_op = &ocfs2_dentry_ops;
74 iput(inode);
75 mlog_errno(-ENOMEM);
76 return ERR_PTR(-ENOMEM);
77 }
78 result->d_op = &ocfs2_dentry_ops;
79 74
80 mlog_exit_ptr(result); 75 mlog_exit_ptr(result);
81 return result; 76 return result;
@@ -86,7 +81,6 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
86 int status; 81 int status;
87 u64 blkno; 82 u64 blkno;
88 struct dentry *parent; 83 struct dentry *parent;
89 struct inode *inode;
90 struct inode *dir = child->d_inode; 84 struct inode *dir = child->d_inode;
91 85
92 mlog_entry("(0x%p, '%.*s')\n", child, 86 mlog_entry("(0x%p, '%.*s')\n", child,
@@ -109,21 +103,9 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
109 goto bail_unlock; 103 goto bail_unlock;
110 } 104 }
111 105
112 inode = ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0, 0); 106 parent = d_obtain_alias(ocfs2_iget(OCFS2_SB(dir->i_sb), blkno, 0, 0));
113 if (IS_ERR(inode)) { 107 if (!IS_ERR(parent))
114 mlog(ML_ERROR, "Unable to create inode %llu\n", 108 parent->d_op = &ocfs2_dentry_ops;
115 (unsigned long long)blkno);
116 parent = ERR_PTR(-EACCES);
117 goto bail_unlock;
118 }
119
120 parent = d_alloc_anon(inode);
121 if (!parent) {
122 iput(inode);
123 parent = ERR_PTR(-ENOMEM);
124 }
125
126 parent->d_op = &ocfs2_dentry_ops;
127 109
128bail_unlock: 110bail_unlock:
129 ocfs2_inode_unlock(dir, 0); 111 ocfs2_inode_unlock(dir, 0);