summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-10-06 11:54:33 -0700
committerMark Fasheh <mark.fasheh@oracle.com>2006-12-01 18:27:22 -0800
commit6d8fc40e63401be065b0aa98dfa4246deca04b8c (patch)
tree4fb08b4284f07e9fe991a3529b33ac598e798605 /fs/ocfs2/namei.c
parent30a4f5e86bc7bc388ce808117e7722706f739602 (diff)
downloadblackbird-op-linux-6d8fc40e63401be065b0aa98dfa4246deca04b8c.tar.gz
blackbird-op-linux-6d8fc40e63401be065b0aa98dfa4246deca04b8c.zip
ocfs2: don't pass handle to ocfs2_meta_lock in ocfs2_symlink()
Take and drop the locks directly. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index f64cff0ceed8..7e9da946c777 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -1603,19 +1603,12 @@ static int ocfs2_symlink(struct inode *dir,
credits = ocfs2_calc_symlink_credits(sb);
- handle = ocfs2_alloc_handle(osb);
- if (handle == NULL) {
- status = -ENOMEM;
- mlog_errno(status);
- goto bail;
- }
-
/* lock the parent directory */
- status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
+ status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
if (status < 0) {
if (status != -ENOENT)
mlog_errno(status);
- goto bail;
+ return status;
}
dirfe = (struct ocfs2_dinode *) parent_fe_bh->b_data;
@@ -1638,6 +1631,13 @@ static int ocfs2_symlink(struct inode *dir,
goto bail;
}
+ handle = ocfs2_alloc_handle(osb);
+ if (handle == NULL) {
+ status = -ENOMEM;
+ mlog_errno(status);
+ goto bail;
+ }
+
status = ocfs2_reserve_new_inode(osb, handle, &inode_ac);
if (status < 0) {
if (status != -ENOSPC)
@@ -1734,6 +1734,9 @@ static int ocfs2_symlink(struct inode *dir,
bail:
if (handle)
ocfs2_commit_trans(handle);
+
+ ocfs2_meta_unlock(dir, 1);
+
if (new_fe_bh)
brelse(new_fe_bh);
if (parent_fe_bh)
OpenPOWER on IntegriCloud