aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-09-11 18:22:06 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2007-10-12 14:54:38 -0400
commitbe94d11704ef79030fd2e6a0c41b4a7f65f9e860 (patch)
tree10b060625c464db127210acc00e8aa80b43ce6f3 /fs/ocfs2/namei.c
parent0bfbbf62a8b5a129ba2c689283bfece80a601aba (diff)
ocfs2: Provide convenience function for ino lookup
A couple paths which needed to just match a parent dir + name pair to an inode number were a bit messy because they had to deal with ocfs2_find_files_on_disk() which returns a larger number of values. Provide a convenience function, ocfs2_lookup_ino_from_name() which internalizes all the extra accounting. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> Reviewed-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index aae6c0bf6696..98aeebc2c9fa 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -101,10 +101,8 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
101{ 101{
102 int status; 102 int status;
103 u64 blkno; 103 u64 blkno;
104 struct buffer_head *dirent_bh = NULL;
105 struct inode *inode = NULL; 104 struct inode *inode = NULL;
106 struct dentry *ret; 105 struct dentry *ret;
107 struct ocfs2_dir_entry *dirent;
108 struct ocfs2_inode_info *oi; 106 struct ocfs2_inode_info *oi;
109 107
110 mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry, 108 mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
@@ -126,9 +124,8 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
126 goto bail; 124 goto bail;
127 } 125 }
128 126
129 status = ocfs2_find_files_on_disk(dentry->d_name.name, 127 status = ocfs2_lookup_ino_from_name(dir, dentry->d_name.name,
130 dentry->d_name.len, &blkno, 128 dentry->d_name.len, &blkno);
131 dir, &dirent_bh, &dirent);
132 if (status < 0) 129 if (status < 0)
133 goto bail_add; 130 goto bail_add;
134 131
@@ -183,8 +180,6 @@ bail_unlock:
183 ocfs2_meta_unlock(dir, 0); 180 ocfs2_meta_unlock(dir, 0);
184 181
185bail: 182bail:
186 if (dirent_bh)
187 brelse(dirent_bh);
188 183
189 mlog_exit_ptr(ret); 184 mlog_exit_ptr(ret);
190 185