aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ocfs2/alloc.c7
-rw-r--r--fs/ocfs2/aops.c8
-rw-r--r--fs/ocfs2/dir.c2
-rw-r--r--fs/ocfs2/dlmglue.c7
-rw-r--r--fs/ocfs2/dlmglue.h4
-rw-r--r--fs/ocfs2/export.c2
-rw-r--r--fs/ocfs2/file.c6
-rw-r--r--fs/ocfs2/inode.c10
-rw-r--r--fs/ocfs2/ioctl.c4
-rw-r--r--fs/ocfs2/journal.c10
-rw-r--r--fs/ocfs2/localalloc.c4
-rw-r--r--fs/ocfs2/namei.c24
-rw-r--r--fs/ocfs2/suballoc.c2
-rw-r--r--fs/ocfs2/super.c2
14 files changed, 41 insertions, 51 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index c8a4727bae8a..22dd60833c9b 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -1152,7 +1152,7 @@ static int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
1152 1152
1153 mutex_lock(&data_alloc_inode->i_mutex); 1153 mutex_lock(&data_alloc_inode->i_mutex);
1154 1154
1155 status = ocfs2_meta_lock(data_alloc_inode, NULL, &data_alloc_bh, 1); 1155 status = ocfs2_meta_lock(data_alloc_inode, &data_alloc_bh, 1);
1156 if (status < 0) { 1156 if (status < 0) {
1157 mlog_errno(status); 1157 mlog_errno(status);
1158 goto out_mutex; 1158 goto out_mutex;
@@ -2003,10 +2003,7 @@ int ocfs2_prepare_truncate(struct ocfs2_super *osb,
2003 mutex_lock(&ext_alloc_inode->i_mutex); 2003 mutex_lock(&ext_alloc_inode->i_mutex);
2004 (*tc)->tc_ext_alloc_inode = ext_alloc_inode; 2004 (*tc)->tc_ext_alloc_inode = ext_alloc_inode;
2005 2005
2006 status = ocfs2_meta_lock(ext_alloc_inode, 2006 status = ocfs2_meta_lock(ext_alloc_inode, &ext_alloc_bh, 1);
2007 NULL,
2008 &ext_alloc_bh,
2009 1);
2010 if (status < 0) { 2007 if (status < 0) {
2011 mlog_errno(status); 2008 mlog_errno(status);
2012 goto bail; 2009 goto bail;
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
index 3d7c082a8f58..196a71cb9764 100644
--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -200,7 +200,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)
200 200
201 mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0)); 201 mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));
202 202
203 ret = ocfs2_meta_lock_with_page(inode, NULL, NULL, 0, page); 203 ret = ocfs2_meta_lock_with_page(inode, NULL, 0, page);
204 if (ret != 0) { 204 if (ret != 0) {
205 if (ret == AOP_TRUNCATED_PAGE) 205 if (ret == AOP_TRUNCATED_PAGE)
206 unlock = 0; 206 unlock = 0;
@@ -305,7 +305,7 @@ static int ocfs2_prepare_write(struct file *file, struct page *page,
305 305
306 mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to); 306 mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
307 307
308 ret = ocfs2_meta_lock_with_page(inode, NULL, NULL, 0, page); 308 ret = ocfs2_meta_lock_with_page(inode, NULL, 0, page);
309 if (ret != 0) { 309 if (ret != 0) {
310 mlog_errno(ret); 310 mlog_errno(ret);
311 goto out; 311 goto out;
@@ -412,7 +412,7 @@ static int ocfs2_commit_write(struct file *file, struct page *page,
412 * stale inode allocation image (i_size, i_clusters, etc). 412 * stale inode allocation image (i_size, i_clusters, etc).
413 */ 413 */
414 414
415 ret = ocfs2_meta_lock_with_page(inode, NULL, &di_bh, 1, page); 415 ret = ocfs2_meta_lock_with_page(inode, &di_bh, 1, page);
416 if (ret != 0) { 416 if (ret != 0) {
417 mlog_errno(ret); 417 mlog_errno(ret);
418 goto out; 418 goto out;
@@ -490,7 +490,7 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
490 * accessed concurrently from multiple nodes. 490 * accessed concurrently from multiple nodes.
491 */ 491 */
492 if (!INODE_JOURNAL(inode)) { 492 if (!INODE_JOURNAL(inode)) {
493 err = ocfs2_meta_lock(inode, NULL, NULL, 0); 493 err = ocfs2_meta_lock(inode, NULL, 0);
494 if (err) { 494 if (err) {
495 if (err != -ENOENT) 495 if (err != -ENOENT)
496 mlog_errno(err); 496 mlog_errno(err);
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index d10ccea82fab..db46ee505782 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -89,7 +89,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
89 stored = 0; 89 stored = 0;
90 bh = NULL; 90 bh = NULL;
91 91
92 error = ocfs2_meta_lock(inode, NULL, NULL, 0); 92 error = ocfs2_meta_lock(inode, NULL, 0);
93 if (error < 0) { 93 if (error < 0) {
94 if (error != -ENOENT) 94 if (error != -ENOENT)
95 mlog_errno(error); 95 mlog_errno(error);
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 1c29b96b99e7..7a22118ef046 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -1579,7 +1579,6 @@ static int ocfs2_assign_bh(struct inode *inode,
1579 * the result of the lock will be communicated via the callback. 1579 * the result of the lock will be communicated via the callback.
1580 */ 1580 */
1581int ocfs2_meta_lock_full(struct inode *inode, 1581int ocfs2_meta_lock_full(struct inode *inode,
1582 struct ocfs2_journal_handle *handle,
1583 struct buffer_head **ret_bh, 1582 struct buffer_head **ret_bh,
1584 int ex, 1583 int ex,
1585 int arg_flags) 1584 int arg_flags)
@@ -1707,18 +1706,16 @@ bail:
1707 * the lock inversion simply. 1706 * the lock inversion simply.
1708 */ 1707 */
1709int ocfs2_meta_lock_with_page(struct inode *inode, 1708int ocfs2_meta_lock_with_page(struct inode *inode,
1710 struct ocfs2_journal_handle *handle,
1711 struct buffer_head **ret_bh, 1709 struct buffer_head **ret_bh,
1712 int ex, 1710 int ex,
1713 struct page *page) 1711 struct page *page)
1714{ 1712{
1715 int ret; 1713 int ret;
1716 1714
1717 ret = ocfs2_meta_lock_full(inode, handle, ret_bh, ex, 1715 ret = ocfs2_meta_lock_full(inode, ret_bh, ex, OCFS2_LOCK_NONBLOCK);
1718 OCFS2_LOCK_NONBLOCK);
1719 if (ret == -EAGAIN) { 1716 if (ret == -EAGAIN) {
1720 unlock_page(page); 1717 unlock_page(page);
1721 if (ocfs2_meta_lock(inode, handle, ret_bh, ex) == 0) 1718 if (ocfs2_meta_lock(inode, ret_bh, ex) == 0)
1722 ocfs2_meta_unlock(inode, ex); 1719 ocfs2_meta_unlock(inode, ex);
1723 ret = AOP_TRUNCATED_PAGE; 1720 ret = AOP_TRUNCATED_PAGE;
1724 } 1721 }
diff --git a/fs/ocfs2/dlmglue.h b/fs/ocfs2/dlmglue.h
index 75c49ce2be32..a1165edef430 100644
--- a/fs/ocfs2/dlmglue.h
+++ b/fs/ocfs2/dlmglue.h
@@ -81,18 +81,16 @@ void ocfs2_data_unlock(struct inode *inode,
81int ocfs2_rw_lock(struct inode *inode, int write); 81int ocfs2_rw_lock(struct inode *inode, int write);
82void ocfs2_rw_unlock(struct inode *inode, int write); 82void ocfs2_rw_unlock(struct inode *inode, int write);
83int ocfs2_meta_lock_full(struct inode *inode, 83int ocfs2_meta_lock_full(struct inode *inode,
84 struct ocfs2_journal_handle *handle,
85 struct buffer_head **ret_bh, 84 struct buffer_head **ret_bh,
86 int ex, 85 int ex,
87 int arg_flags); 86 int arg_flags);
88int ocfs2_meta_lock_with_page(struct inode *inode, 87int ocfs2_meta_lock_with_page(struct inode *inode,
89 struct ocfs2_journal_handle *handle,
90 struct buffer_head **ret_bh, 88 struct buffer_head **ret_bh,
91 int ex, 89 int ex,
92 struct page *page); 90 struct page *page);
93/* 99% of the time we don't want to supply any additional flags -- 91/* 99% of the time we don't want to supply any additional flags --
94 * those are for very specific cases only. */ 92 * those are for very specific cases only. */
95#define ocfs2_meta_lock(i, h, b, e) ocfs2_meta_lock_full(i, h, b, e, 0) 93#define ocfs2_meta_lock(i, b, e) ocfs2_meta_lock_full(i, b, e, 0)
96void ocfs2_meta_unlock(struct inode *inode, 94void ocfs2_meta_unlock(struct inode *inode,
97 int ex); 95 int ex);
98int ocfs2_super_lock(struct ocfs2_super *osb, 96int ocfs2_super_lock(struct ocfs2_super *osb,
diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index fb91089a60a7..06be6e774cf9 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -100,7 +100,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
100 mlog(0, "find parent of directory %llu\n", 100 mlog(0, "find parent of directory %llu\n",
101 (unsigned long long)OCFS2_I(dir)->ip_blkno); 101 (unsigned long long)OCFS2_I(dir)->ip_blkno);
102 102
103 status = ocfs2_meta_lock(dir, NULL, NULL, 0); 103 status = ocfs2_meta_lock(dir, NULL, 0);
104 if (status < 0) { 104 if (status < 0) {
105 if (status != -ENOENT) 105 if (status != -ENOENT)
106 mlog_errno(status); 106 mlog_errno(status);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index bd944e893bbe..bcae2693e957 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -812,7 +812,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
812 } 812 }
813 } 813 }
814 814
815 status = ocfs2_meta_lock(inode, NULL, &bh, 1); 815 status = ocfs2_meta_lock(inode, &bh, 1);
816 if (status < 0) { 816 if (status < 0) {
817 if (status != -ENOENT) 817 if (status != -ENOENT)
818 mlog_errno(status); 818 mlog_errno(status);
@@ -1006,7 +1006,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
1006 */ 1006 */
1007 meta_level = (filp->f_flags & O_APPEND) ? 1 : 0; 1007 meta_level = (filp->f_flags & O_APPEND) ? 1 : 0;
1008 for(;;) { 1008 for(;;) {
1009 ret = ocfs2_meta_lock(inode, NULL, NULL, meta_level); 1009 ret = ocfs2_meta_lock(inode, NULL, meta_level);
1010 if (ret < 0) { 1010 if (ret < 0) {
1011 meta_level = -1; 1011 meta_level = -1;
1012 mlog_errno(ret); 1012 mlog_errno(ret);
@@ -1174,7 +1174,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb,
1174 * like i_size. This allows the checks down below 1174 * like i_size. This allows the checks down below
1175 * generic_file_aio_read() a chance of actually working. 1175 * generic_file_aio_read() a chance of actually working.
1176 */ 1176 */
1177 ret = ocfs2_meta_lock(inode, NULL, NULL, 0); 1177 ret = ocfs2_meta_lock(inode, NULL, 0);
1178 if (ret < 0) { 1178 if (ret < 0) {
1179 mlog_errno(ret); 1179 mlog_errno(ret);
1180 goto bail; 1180 goto bail;
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 20e60e4b1f10..dec0ece6267a 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -441,7 +441,7 @@ static int ocfs2_read_locked_inode(struct inode *inode,
441 generation, inode); 441 generation, inode);
442 442
443 if (can_lock) { 443 if (can_lock) {
444 status = ocfs2_meta_lock(inode, NULL, NULL, 0); 444 status = ocfs2_meta_lock(inode, NULL, 0);
445 if (status) { 445 if (status) {
446 make_bad_inode(inode); 446 make_bad_inode(inode);
447 mlog_errno(status); 447 mlog_errno(status);
@@ -582,7 +582,7 @@ static int ocfs2_remove_inode(struct inode *inode,
582 } 582 }
583 583
584 mutex_lock(&inode_alloc_inode->i_mutex); 584 mutex_lock(&inode_alloc_inode->i_mutex);
585 status = ocfs2_meta_lock(inode_alloc_inode, NULL, &inode_alloc_bh, 1); 585 status = ocfs2_meta_lock(inode_alloc_inode, &inode_alloc_bh, 1);
586 if (status < 0) { 586 if (status < 0) {
587 mutex_unlock(&inode_alloc_inode->i_mutex); 587 mutex_unlock(&inode_alloc_inode->i_mutex);
588 588
@@ -705,7 +705,7 @@ static int ocfs2_wipe_inode(struct inode *inode,
705 * delete_inode operation. We do this now to avoid races with 705 * delete_inode operation. We do this now to avoid races with
706 * recovery completion on other nodes. */ 706 * recovery completion on other nodes. */
707 mutex_lock(&orphan_dir_inode->i_mutex); 707 mutex_lock(&orphan_dir_inode->i_mutex);
708 status = ocfs2_meta_lock(orphan_dir_inode, NULL, &orphan_dir_bh, 1); 708 status = ocfs2_meta_lock(orphan_dir_inode, &orphan_dir_bh, 1);
709 if (status < 0) { 709 if (status < 0) {
710 mutex_unlock(&orphan_dir_inode->i_mutex); 710 mutex_unlock(&orphan_dir_inode->i_mutex);
711 711
@@ -933,7 +933,7 @@ void ocfs2_delete_inode(struct inode *inode)
933 * allocation lock here as it won't be needed - nobody will 933 * allocation lock here as it won't be needed - nobody will
934 * have the file open. 934 * have the file open.
935 */ 935 */
936 status = ocfs2_meta_lock(inode, NULL, &di_bh, 1); 936 status = ocfs2_meta_lock(inode, &di_bh, 1);
937 if (status < 0) { 937 if (status < 0) {
938 if (status != -ENOENT) 938 if (status != -ENOENT)
939 mlog_errno(status); 939 mlog_errno(status);
@@ -1180,7 +1180,7 @@ int ocfs2_inode_revalidate(struct dentry *dentry)
1180 1180
1181 /* Let ocfs2_meta_lock do the work of updating our struct 1181 /* Let ocfs2_meta_lock do the work of updating our struct
1182 * inode for us. */ 1182 * inode for us. */
1183 status = ocfs2_meta_lock(inode, NULL, NULL, 0); 1183 status = ocfs2_meta_lock(inode, NULL, 0);
1184 if (status < 0) { 1184 if (status < 0) {
1185 if (status != -ENOENT) 1185 if (status != -ENOENT)
1186 mlog_errno(status); 1186 mlog_errno(status);
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index 3663cef80689..16d8861b281f 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -26,7 +26,7 @@ static int ocfs2_get_inode_attr(struct inode *inode, unsigned *flags)
26{ 26{
27 int status; 27 int status;
28 28
29 status = ocfs2_meta_lock(inode, NULL, NULL, 0); 29 status = ocfs2_meta_lock(inode, NULL, 0);
30 if (status < 0) { 30 if (status < 0) {
31 mlog_errno(status); 31 mlog_errno(status);
32 return status; 32 return status;
@@ -50,7 +50,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
50 50
51 mutex_lock(&inode->i_mutex); 51 mutex_lock(&inode->i_mutex);
52 52
53 status = ocfs2_meta_lock(inode, NULL, &bh, 1); 53 status = ocfs2_meta_lock(inode, &bh, 1);
54 if (status < 0) { 54 if (status < 0) {
55 mlog_errno(status); 55 mlog_errno(status);
56 goto bail; 56 goto bail;
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index f070487a0551..61db8e7fffa5 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -424,8 +424,7 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
424 /* Skip recovery waits here - journal inode metadata never 424 /* Skip recovery waits here - journal inode metadata never
425 * changes in a live cluster so it can be considered an 425 * changes in a live cluster so it can be considered an
426 * exception to the rule. */ 426 * exception to the rule. */
427 status = ocfs2_meta_lock_full(inode, NULL, &bh, 1, 427 status = ocfs2_meta_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);
428 OCFS2_META_LOCK_RECOVERY);
429 if (status < 0) { 428 if (status < 0) {
430 if (status != -ERESTARTSYS) 429 if (status != -ERESTARTSYS)
431 mlog(ML_ERROR, "Could not get lock on journal!\n"); 430 mlog(ML_ERROR, "Could not get lock on journal!\n");
@@ -1022,8 +1021,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
1022 } 1021 }
1023 SET_INODE_JOURNAL(inode); 1022 SET_INODE_JOURNAL(inode);
1024 1023
1025 status = ocfs2_meta_lock_full(inode, NULL, &bh, 1, 1024 status = ocfs2_meta_lock_full(inode, &bh, 1, OCFS2_META_LOCK_RECOVERY);
1026 OCFS2_META_LOCK_RECOVERY);
1027 if (status < 0) { 1025 if (status < 0) {
1028 mlog(0, "status returned from ocfs2_meta_lock=%d\n", status); 1026 mlog(0, "status returned from ocfs2_meta_lock=%d\n", status);
1029 if (status != -ERESTARTSYS) 1027 if (status != -ERESTARTSYS)
@@ -1212,7 +1210,7 @@ static int ocfs2_trylock_journal(struct ocfs2_super *osb,
1212 SET_INODE_JOURNAL(inode); 1210 SET_INODE_JOURNAL(inode);
1213 1211
1214 flags = OCFS2_META_LOCK_RECOVERY | OCFS2_META_LOCK_NOQUEUE; 1212 flags = OCFS2_META_LOCK_RECOVERY | OCFS2_META_LOCK_NOQUEUE;
1215 status = ocfs2_meta_lock_full(inode, NULL, NULL, 1, flags); 1213 status = ocfs2_meta_lock_full(inode, NULL, 1, flags);
1216 if (status < 0) { 1214 if (status < 0) {
1217 if (status != -EAGAIN) 1215 if (status != -EAGAIN)
1218 mlog_errno(status); 1216 mlog_errno(status);
@@ -1295,7 +1293,7 @@ static int ocfs2_queue_orphans(struct ocfs2_super *osb,
1295 } 1293 }
1296 1294
1297 mutex_lock(&orphan_dir_inode->i_mutex); 1295 mutex_lock(&orphan_dir_inode->i_mutex);
1298 status = ocfs2_meta_lock(orphan_dir_inode, NULL, NULL, 0); 1296 status = ocfs2_meta_lock(orphan_dir_inode, NULL, 0);
1299 if (status < 0) { 1297 if (status < 0) {
1300 mlog_errno(status); 1298 mlog_errno(status);
1301 goto out; 1299 goto out;
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index 869383e7c562..4c46c0a81e00 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -231,7 +231,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
231 231
232 mutex_lock(&main_bm_inode->i_mutex); 232 mutex_lock(&main_bm_inode->i_mutex);
233 233
234 status = ocfs2_meta_lock(main_bm_inode, NULL, &main_bm_bh, 1); 234 status = ocfs2_meta_lock(main_bm_inode, &main_bm_bh, 1);
235 if (status < 0) { 235 if (status < 0) {
236 mlog_errno(status); 236 mlog_errno(status);
237 goto out_mutex; 237 goto out_mutex;
@@ -399,7 +399,7 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
399 399
400 mutex_lock(&main_bm_inode->i_mutex); 400 mutex_lock(&main_bm_inode->i_mutex);
401 401
402 status = ocfs2_meta_lock(main_bm_inode, NULL, &main_bm_bh, 1); 402 status = ocfs2_meta_lock(main_bm_inode, &main_bm_bh, 1);
403 if (status < 0) { 403 if (status < 0) {
404 mlog_errno(status); 404 mlog_errno(status);
405 goto out_mutex; 405 goto out_mutex;
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 8d03ef446868..daf70605afa8 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -159,7 +159,7 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
159 mlog(0, "find name %.*s in directory %llu\n", dentry->d_name.len, 159 mlog(0, "find name %.*s in directory %llu\n", dentry->d_name.len,
160 dentry->d_name.name, (unsigned long long)OCFS2_I(dir)->ip_blkno); 160 dentry->d_name.name, (unsigned long long)OCFS2_I(dir)->ip_blkno);
161 161
162 status = ocfs2_meta_lock(dir, NULL, NULL, 0); 162 status = ocfs2_meta_lock(dir, NULL, 0);
163 if (status < 0) { 163 if (status < 0) {
164 if (status != -ENOENT) 164 if (status != -ENOENT)
165 mlog_errno(status); 165 mlog_errno(status);
@@ -327,7 +327,7 @@ static int ocfs2_mknod(struct inode *dir,
327 /* get our super block */ 327 /* get our super block */
328 osb = OCFS2_SB(dir->i_sb); 328 osb = OCFS2_SB(dir->i_sb);
329 329
330 status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1); 330 status = ocfs2_meta_lock(dir, &parent_fe_bh, 1);
331 if (status < 0) { 331 if (status < 0) {
332 if (status != -ENOENT) 332 if (status != -ENOENT)
333 mlog_errno(status); 333 mlog_errno(status);
@@ -658,7 +658,7 @@ static int ocfs2_link(struct dentry *old_dentry,
658 if (S_ISDIR(inode->i_mode)) 658 if (S_ISDIR(inode->i_mode))
659 return -EPERM; 659 return -EPERM;
660 660
661 err = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1); 661 err = ocfs2_meta_lock(dir, &parent_fe_bh, 1);
662 if (err < 0) { 662 if (err < 0) {
663 if (err != -ENOENT) 663 if (err != -ENOENT)
664 mlog_errno(err); 664 mlog_errno(err);
@@ -683,7 +683,7 @@ static int ocfs2_link(struct dentry *old_dentry,
683 goto out; 683 goto out;
684 } 684 }
685 685
686 err = ocfs2_meta_lock(inode, NULL, &fe_bh, 1); 686 err = ocfs2_meta_lock(inode, &fe_bh, 1);
687 if (err < 0) { 687 if (err < 0) {
688 if (err != -ENOENT) 688 if (err != -ENOENT)
689 mlog_errno(err); 689 mlog_errno(err);
@@ -825,7 +825,7 @@ static int ocfs2_unlink(struct inode *dir,
825 return -EPERM; 825 return -EPERM;
826 } 826 }
827 827
828 status = ocfs2_meta_lock(dir, NULL, &parent_node_bh, 1); 828 status = ocfs2_meta_lock(dir, &parent_node_bh, 1);
829 if (status < 0) { 829 if (status < 0) {
830 if (status != -ENOENT) 830 if (status != -ENOENT)
831 mlog_errno(status); 831 mlog_errno(status);
@@ -850,7 +850,7 @@ static int ocfs2_unlink(struct inode *dir,
850 goto leave; 850 goto leave;
851 } 851 }
852 852
853 status = ocfs2_meta_lock(inode, NULL, &fe_bh, 1); 853 status = ocfs2_meta_lock(inode, &fe_bh, 1);
854 if (status < 0) { 854 if (status < 0) {
855 if (status != -ENOENT) 855 if (status != -ENOENT)
856 mlog_errno(status); 856 mlog_errno(status);
@@ -1012,7 +1012,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
1012 inode1 = tmpinode; 1012 inode1 = tmpinode;
1013 } 1013 }
1014 /* lock id2 */ 1014 /* lock id2 */
1015 status = ocfs2_meta_lock(inode2, NULL, bh2, 1); 1015 status = ocfs2_meta_lock(inode2, bh2, 1);
1016 if (status < 0) { 1016 if (status < 0) {
1017 if (status != -ENOENT) 1017 if (status != -ENOENT)
1018 mlog_errno(status); 1018 mlog_errno(status);
@@ -1021,7 +1021,7 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
1021 } 1021 }
1022 1022
1023 /* lock id1 */ 1023 /* lock id1 */
1024 status = ocfs2_meta_lock(inode1, NULL, bh1, 1); 1024 status = ocfs2_meta_lock(inode1, bh1, 1);
1025 if (status < 0) { 1025 if (status < 0) {
1026 /* 1026 /*
1027 * An error return must mean that no cluster locks 1027 * An error return must mean that no cluster locks
@@ -1142,7 +1142,7 @@ static int ocfs2_rename(struct inode *old_dir,
1142 * the vote thread on other nodes won't have to concurrently 1142 * the vote thread on other nodes won't have to concurrently
1143 * downconvert the inode and the dentry locks. 1143 * downconvert the inode and the dentry locks.
1144 */ 1144 */
1145 status = ocfs2_meta_lock(old_inode, NULL, NULL, 1); 1145 status = ocfs2_meta_lock(old_inode, NULL, 1);
1146 if (status < 0) { 1146 if (status < 0) {
1147 if (status != -ENOENT) 1147 if (status != -ENOENT)
1148 mlog_errno(status); 1148 mlog_errno(status);
@@ -1234,7 +1234,7 @@ static int ocfs2_rename(struct inode *old_dir,
1234 goto bail; 1234 goto bail;
1235 } 1235 }
1236 1236
1237 status = ocfs2_meta_lock(new_inode, NULL, &newfe_bh, 1); 1237 status = ocfs2_meta_lock(new_inode, &newfe_bh, 1);
1238 if (status < 0) { 1238 if (status < 0) {
1239 if (status != -ENOENT) 1239 if (status != -ENOENT)
1240 mlog_errno(status); 1240 mlog_errno(status);
@@ -1608,7 +1608,7 @@ static int ocfs2_symlink(struct inode *dir,
1608 credits = ocfs2_calc_symlink_credits(sb); 1608 credits = ocfs2_calc_symlink_credits(sb);
1609 1609
1610 /* lock the parent directory */ 1610 /* lock the parent directory */
1611 status = ocfs2_meta_lock(dir, NULL, &parent_fe_bh, 1); 1611 status = ocfs2_meta_lock(dir, &parent_fe_bh, 1);
1612 if (status < 0) { 1612 if (status < 0) {
1613 if (status != -ENOENT) 1613 if (status != -ENOENT)
1614 mlog_errno(status); 1614 mlog_errno(status);
@@ -2127,7 +2127,7 @@ static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb,
2127 2127
2128 mutex_lock(&orphan_dir_inode->i_mutex); 2128 mutex_lock(&orphan_dir_inode->i_mutex);
2129 2129
2130 status = ocfs2_meta_lock(orphan_dir_inode, NULL, &orphan_dir_bh, 1); 2130 status = ocfs2_meta_lock(orphan_dir_inode, &orphan_dir_bh, 1);
2131 if (status < 0) { 2131 if (status < 0) {
2132 mlog_errno(status); 2132 mlog_errno(status);
2133 goto leave; 2133 goto leave;
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 31bda54fefe3..27f8dc4c819c 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -421,7 +421,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
421 421
422 mutex_lock(&alloc_inode->i_mutex); 422 mutex_lock(&alloc_inode->i_mutex);
423 423
424 status = ocfs2_meta_lock(alloc_inode, NULL, &bh, 1); 424 status = ocfs2_meta_lock(alloc_inode, &bh, 1);
425 if (status < 0) { 425 if (status < 0) {
426 mutex_unlock(&alloc_inode->i_mutex); 426 mutex_unlock(&alloc_inode->i_mutex);
427 iput(alloc_inode); 427 iput(alloc_inode);
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 290d531bed61..d9b1eb6a3c6e 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -865,7 +865,7 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
865 goto bail; 865 goto bail;
866 } 866 }
867 867
868 status = ocfs2_meta_lock(inode, NULL, &bh, 0); 868 status = ocfs2_meta_lock(inode, &bh, 0);
869 if (status < 0) { 869 if (status < 0) {
870 mlog_errno(status); 870 mlog_errno(status);
871 goto bail; 871 goto bail;