diff options
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index ebfe36ab2d5e..052c4cf7db95 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -719,8 +719,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb, | |||
719 | 719 | ||
720 | retval = le16_to_cpu(el->l_count) - le16_to_cpu(el->l_next_free_rec); | 720 | retval = le16_to_cpu(el->l_count) - le16_to_cpu(el->l_next_free_rec); |
721 | bail: | 721 | bail: |
722 | if (eb_bh) | 722 | brelse(eb_bh); |
723 | brelse(eb_bh); | ||
724 | 723 | ||
725 | mlog_exit(retval); | 724 | mlog_exit(retval); |
726 | return retval; | 725 | return retval; |
@@ -806,8 +805,7 @@ static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb, | |||
806 | bail: | 805 | bail: |
807 | if (status < 0) { | 806 | if (status < 0) { |
808 | for(i = 0; i < wanted; i++) { | 807 | for(i = 0; i < wanted; i++) { |
809 | if (bhs[i]) | 808 | brelse(bhs[i]); |
810 | brelse(bhs[i]); | ||
811 | bhs[i] = NULL; | 809 | bhs[i] = NULL; |
812 | } | 810 | } |
813 | } | 811 | } |
@@ -1017,8 +1015,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb, | |||
1017 | bail: | 1015 | bail: |
1018 | if (new_eb_bhs) { | 1016 | if (new_eb_bhs) { |
1019 | for (i = 0; i < new_blocks; i++) | 1017 | for (i = 0; i < new_blocks; i++) |
1020 | if (new_eb_bhs[i]) | 1018 | brelse(new_eb_bhs[i]); |
1021 | brelse(new_eb_bhs[i]); | ||
1022 | kfree(new_eb_bhs); | 1019 | kfree(new_eb_bhs); |
1023 | } | 1020 | } |
1024 | 1021 | ||
@@ -1116,8 +1113,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb, | |||
1116 | new_eb_bh = NULL; | 1113 | new_eb_bh = NULL; |
1117 | status = 0; | 1114 | status = 0; |
1118 | bail: | 1115 | bail: |
1119 | if (new_eb_bh) | 1116 | brelse(new_eb_bh); |
1120 | brelse(new_eb_bh); | ||
1121 | 1117 | ||
1122 | mlog_exit(status); | 1118 | mlog_exit(status); |
1123 | return status; | 1119 | return status; |
@@ -1177,10 +1173,8 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb, | |||
1177 | goto bail; | 1173 | goto bail; |
1178 | } | 1174 | } |
1179 | 1175 | ||
1180 | if (bh) { | 1176 | brelse(bh); |
1181 | brelse(bh); | 1177 | bh = NULL; |
1182 | bh = NULL; | ||
1183 | } | ||
1184 | 1178 | ||
1185 | status = ocfs2_read_block(osb, blkno, &bh, OCFS2_BH_CACHED, | 1179 | status = ocfs2_read_block(osb, blkno, &bh, OCFS2_BH_CACHED, |
1186 | inode); | 1180 | inode); |
@@ -1199,8 +1193,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb, | |||
1199 | 1193 | ||
1200 | if (le16_to_cpu(el->l_next_free_rec) < | 1194 | if (le16_to_cpu(el->l_next_free_rec) < |
1201 | le16_to_cpu(el->l_count)) { | 1195 | le16_to_cpu(el->l_count)) { |
1202 | if (lowest_bh) | 1196 | brelse(lowest_bh); |
1203 | brelse(lowest_bh); | ||
1204 | lowest_bh = bh; | 1197 | lowest_bh = bh; |
1205 | get_bh(lowest_bh); | 1198 | get_bh(lowest_bh); |
1206 | } | 1199 | } |
@@ -1214,8 +1207,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb, | |||
1214 | 1207 | ||
1215 | *target_bh = lowest_bh; | 1208 | *target_bh = lowest_bh; |
1216 | bail: | 1209 | bail: |
1217 | if (bh) | 1210 | brelse(bh); |
1218 | brelse(bh); | ||
1219 | 1211 | ||
1220 | mlog_exit(status); | 1212 | mlog_exit(status); |
1221 | return status; | 1213 | return status; |
@@ -4471,8 +4463,7 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, | |||
4471 | ocfs2_extent_map_insert_rec(inode, &rec); | 4463 | ocfs2_extent_map_insert_rec(inode, &rec); |
4472 | 4464 | ||
4473 | bail: | 4465 | bail: |
4474 | if (last_eb_bh) | 4466 | brelse(last_eb_bh); |
4475 | brelse(last_eb_bh); | ||
4476 | 4467 | ||
4477 | mlog_exit(status); | 4468 | mlog_exit(status); |
4478 | return status; | 4469 | return status; |
@@ -5677,8 +5668,7 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, | |||
5677 | bail: | 5668 | bail: |
5678 | if (tl_inode) | 5669 | if (tl_inode) |
5679 | iput(tl_inode); | 5670 | iput(tl_inode); |
5680 | if (tl_bh) | 5671 | brelse(tl_bh); |
5681 | brelse(tl_bh); | ||
5682 | 5672 | ||
5683 | if (status < 0 && (*tl_copy)) { | 5673 | if (status < 0 && (*tl_copy)) { |
5684 | kfree(*tl_copy); | 5674 | kfree(*tl_copy); |
@@ -7115,8 +7105,7 @@ static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc) | |||
7115 | mlog(ML_NOTICE, | 7105 | mlog(ML_NOTICE, |
7116 | "Truncate completion has non-empty dealloc context\n"); | 7106 | "Truncate completion has non-empty dealloc context\n"); |
7117 | 7107 | ||
7118 | if (tc->tc_last_eb_bh) | 7108 | brelse(tc->tc_last_eb_bh); |
7119 | brelse(tc->tc_last_eb_bh); | ||
7120 | 7109 | ||
7121 | kfree(tc); | 7110 | kfree(tc); |
7122 | } | 7111 | } |