summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2006-10-05 16:04:17 -0700
committerMark Fasheh <mark.fasheh@oracle.com>2006-12-01 18:27:12 -0800
commite3a821385984e57d5dd1b0e7292761abb0ea4dd9 (patch)
tree2a833a3780e8eddbf4b502ec1012cc9854019fe0 /fs/ocfs2/namei.c
parente08dc8b9808f06d412904db4d67434bf19984752 (diff)
downloadop-kernel-dev-e3a821385984e57d5dd1b0e7292761abb0ea4dd9.zip
op-kernel-dev-e3a821385984e57d5dd1b0e7292761abb0ea4dd9.tar.gz
ocfs2: don't pass handle to ocfs2_meta_lock() in ocfs2_mknod()
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.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index a57b751..702f0c3 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -333,6 +333,13 @@ static int ocfs2_mknod(struct inode *dir,
/* get our super block */
osb = OCFS2_SB(dir->i_sb);
+ status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1);
+ if (status < 0) {
+ if (status != -ENOENT)
+ mlog_errno(status);
+ return status;
+ }
+
handle = ocfs2_alloc_handle(osb);
if (handle == NULL) {
status = -ENOMEM;
@@ -340,13 +347,6 @@ static int ocfs2_mknod(struct inode *dir,
goto leave;
}
- status = ocfs2_meta_lock(dir, handle, &parent_fe_bh, 1);
- if (status < 0) {
- if (status != -ENOENT)
- mlog_errno(status);
- goto leave;
- }
-
if (S_ISDIR(mode) && (dir->i_nlink >= OCFS2_LINK_MAX)) {
status = -EMLINK;
goto leave;
@@ -455,6 +455,8 @@ leave:
if (handle)
ocfs2_commit_trans(handle);
+ ocfs2_meta_unlock(dir, 1);
+
if (status == -ENOSPC)
mlog(0, "Disk is full\n");
OpenPOWER on IntegriCloud