aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/suballoc.c
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2008-10-07 17:25:16 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-13 20:02:44 -0400
commita81cb88b64a479b78c6dd5666678d50171865db8 (patch)
tree9fe0f67e30d7c70d43785827e57736ac01558c24 /fs/ocfs2/suballoc.c
parentfd8351f83d413b41da956109cf429c15881886e2 (diff)
ocfs2: Don't check for NULL before brelse()
This is pointless as brelse() already does the check. Signed-off-by: Mark Fasheh
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r--fs/ocfs2/suballoc.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index d7a6f928c317..08d8844a3c2d 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -130,10 +130,8 @@ void ocfs2_free_ac_resource(struct ocfs2_alloc_context *ac)
130 iput(inode); 130 iput(inode);
131 ac->ac_inode = NULL; 131 ac->ac_inode = NULL;
132 } 132 }
133 if (ac->ac_bh) { 133 brelse(ac->ac_bh);
134 brelse(ac->ac_bh); 134 ac->ac_bh = NULL;
135 ac->ac_bh = NULL;
136 }
137} 135}
138 136
139void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac) 137void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac)
@@ -401,8 +399,7 @@ bail:
401 if (ac) 399 if (ac)
402 ocfs2_free_alloc_context(ac); 400 ocfs2_free_alloc_context(ac);
403 401
404 if (bg_bh) 402 brelse(bg_bh);
405 brelse(bg_bh);
406 403
407 mlog_exit(status); 404 mlog_exit(status);
408 return status; 405 return status;
@@ -494,8 +491,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
494 get_bh(bh); 491 get_bh(bh);
495 ac->ac_bh = bh; 492 ac->ac_bh = bh;
496bail: 493bail:
497 if (bh) 494 brelse(bh);
498 brelse(bh);
499 495
500 mlog_exit(status); 496 mlog_exit(status);
501 return status; 497 return status;
@@ -1269,10 +1265,10 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1269 &tmp_bits)) == -ENOSPC) { 1265 &tmp_bits)) == -ENOSPC) {
1270 if (!bg->bg_next_group) 1266 if (!bg->bg_next_group)
1271 break; 1267 break;
1272 if (prev_group_bh) { 1268
1273 brelse(prev_group_bh); 1269 brelse(prev_group_bh);
1274 prev_group_bh = NULL; 1270 prev_group_bh = NULL;
1275 } 1271
1276 next_group = le64_to_cpu(bg->bg_next_group); 1272 next_group = le64_to_cpu(bg->bg_next_group);
1277 prev_group_bh = group_bh; 1273 prev_group_bh = group_bh;
1278 group_bh = NULL; 1274 group_bh = NULL;
@@ -1367,10 +1363,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
1367 *bg_blkno = le64_to_cpu(bg->bg_blkno); 1363 *bg_blkno = le64_to_cpu(bg->bg_blkno);
1368 *bits_left = le16_to_cpu(bg->bg_free_bits_count); 1364 *bits_left = le16_to_cpu(bg->bg_free_bits_count);
1369bail: 1365bail:
1370 if (group_bh) 1366 brelse(group_bh);
1371 brelse(group_bh); 1367 brelse(prev_group_bh);
1372 if (prev_group_bh)
1373 brelse(prev_group_bh);
1374 1368
1375 mlog_exit(status); 1369 mlog_exit(status);
1376 return status; 1370 return status;
@@ -1844,8 +1838,7 @@ int ocfs2_free_suballoc_bits(handle_t *handle,
1844 } 1838 }
1845 1839
1846bail: 1840bail:
1847 if (group_bh) 1841 brelse(group_bh);
1848 brelse(group_bh);
1849 1842
1850 mlog_exit(status); 1843 mlog_exit(status);
1851 return status; 1844 return status;