diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-03-19 17:13:52 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-05-05 21:17:29 -0400 |
commit | ec20cec7a351584ca6c70ead012e73d61f9a8e04 (patch) | |
tree | 39af308ae07ab168313bb50ced1bb1ae7ef7e6a3 /fs | |
parent | b4414eea0e7b9c134262c801a87e338bf675962c (diff) |
ocfs2: Make ocfs2_journal_dirty() void.
jbd[2]_journal_dirty_metadata() only returns 0. It's been returning 0
since before the kernel moved to git. There is no point in checking
this error.
ocfs2_journal_dirty() has been faithfully returning the status since the
beginning. All over ocfs2, we have blocks of code checking this can't
fail status. In the past few years, we've tried to avoid adding these
checks, because they are pointless. But anyone who looks at our code
assumes they are needed.
Finally, ocfs2_journal_dirty() is made a void function. All error
checking is removed from other files. We'll BUG_ON() the status of
jbd2_journal_dirty_metadata() just in case they change it someday. They
won't.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/alloc.c | 164 | ||||
-rw-r--r-- | fs/ocfs2/dir.c | 48 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 19 | ||||
-rw-r--r-- | fs/ocfs2/inode.c | 14 | ||||
-rw-r--r-- | fs/ocfs2/journal.c | 11 | ||||
-rw-r--r-- | fs/ocfs2/journal.h | 3 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.c | 23 | ||||
-rw-r--r-- | fs/ocfs2/namei.c | 62 | ||||
-rw-r--r-- | fs/ocfs2/quota_global.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/quota_local.c | 50 | ||||
-rw-r--r-- | fs/ocfs2/refcounttree.c | 20 | ||||
-rw-r--r-- | fs/ocfs2/resize.c | 13 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.c | 64 | ||||
-rw-r--r-- | fs/ocfs2/xattr.c | 38 |
14 files changed, 102 insertions, 431 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 9f8bd913c51e..89e994dad026 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -1061,11 +1061,7 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle, | |||
1061 | 1061 | ||
1062 | /* We'll also be dirtied by the caller, so | 1062 | /* We'll also be dirtied by the caller, so |
1063 | * this isn't absolutely necessary. */ | 1063 | * this isn't absolutely necessary. */ |
1064 | status = ocfs2_journal_dirty(handle, bhs[i]); | 1064 | ocfs2_journal_dirty(handle, bhs[i]); |
1065 | if (status < 0) { | ||
1066 | mlog_errno(status); | ||
1067 | goto bail; | ||
1068 | } | ||
1069 | } | 1065 | } |
1070 | 1066 | ||
1071 | count += num_got; | 1067 | count += num_got; |
@@ -1270,12 +1266,7 @@ static int ocfs2_add_branch(handle_t *handle, | |||
1270 | if (!eb_el->l_tree_depth) | 1266 | if (!eb_el->l_tree_depth) |
1271 | new_last_eb_blk = le64_to_cpu(eb->h_blkno); | 1267 | new_last_eb_blk = le64_to_cpu(eb->h_blkno); |
1272 | 1268 | ||
1273 | status = ocfs2_journal_dirty(handle, bh); | 1269 | ocfs2_journal_dirty(handle, bh); |
1274 | if (status < 0) { | ||
1275 | mlog_errno(status); | ||
1276 | goto bail; | ||
1277 | } | ||
1278 | |||
1279 | next_blkno = le64_to_cpu(eb->h_blkno); | 1270 | next_blkno = le64_to_cpu(eb->h_blkno); |
1280 | } | 1271 | } |
1281 | 1272 | ||
@@ -1321,17 +1312,10 @@ static int ocfs2_add_branch(handle_t *handle, | |||
1321 | eb = (struct ocfs2_extent_block *) (*last_eb_bh)->b_data; | 1312 | eb = (struct ocfs2_extent_block *) (*last_eb_bh)->b_data; |
1322 | eb->h_next_leaf_blk = cpu_to_le64(new_last_eb_blk); | 1313 | eb->h_next_leaf_blk = cpu_to_le64(new_last_eb_blk); |
1323 | 1314 | ||
1324 | status = ocfs2_journal_dirty(handle, *last_eb_bh); | 1315 | ocfs2_journal_dirty(handle, *last_eb_bh); |
1325 | if (status < 0) | 1316 | ocfs2_journal_dirty(handle, et->et_root_bh); |
1326 | mlog_errno(status); | 1317 | if (eb_bh) |
1327 | status = ocfs2_journal_dirty(handle, et->et_root_bh); | 1318 | ocfs2_journal_dirty(handle, eb_bh); |
1328 | if (status < 0) | ||
1329 | mlog_errno(status); | ||
1330 | if (eb_bh) { | ||
1331 | status = ocfs2_journal_dirty(handle, eb_bh); | ||
1332 | if (status < 0) | ||
1333 | mlog_errno(status); | ||
1334 | } | ||
1335 | 1319 | ||
1336 | /* | 1320 | /* |
1337 | * Some callers want to track the rightmost leaf so pass it | 1321 | * Some callers want to track the rightmost leaf so pass it |
@@ -1399,11 +1383,7 @@ static int ocfs2_shift_tree_depth(handle_t *handle, | |||
1399 | for (i = 0; i < le16_to_cpu(root_el->l_next_free_rec); i++) | 1383 | for (i = 0; i < le16_to_cpu(root_el->l_next_free_rec); i++) |
1400 | eb_el->l_recs[i] = root_el->l_recs[i]; | 1384 | eb_el->l_recs[i] = root_el->l_recs[i]; |
1401 | 1385 | ||
1402 | status = ocfs2_journal_dirty(handle, new_eb_bh); | 1386 | ocfs2_journal_dirty(handle, new_eb_bh); |
1403 | if (status < 0) { | ||
1404 | mlog_errno(status); | ||
1405 | goto bail; | ||
1406 | } | ||
1407 | 1387 | ||
1408 | status = ocfs2_et_root_journal_access(handle, et, | 1388 | status = ocfs2_et_root_journal_access(handle, et, |
1409 | OCFS2_JOURNAL_ACCESS_WRITE); | 1389 | OCFS2_JOURNAL_ACCESS_WRITE); |
@@ -1428,11 +1408,7 @@ static int ocfs2_shift_tree_depth(handle_t *handle, | |||
1428 | if (root_el->l_tree_depth == cpu_to_le16(1)) | 1408 | if (root_el->l_tree_depth == cpu_to_le16(1)) |
1429 | ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); | 1409 | ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno)); |
1430 | 1410 | ||
1431 | status = ocfs2_journal_dirty(handle, et->et_root_bh); | 1411 | ocfs2_journal_dirty(handle, et->et_root_bh); |
1432 | if (status < 0) { | ||
1433 | mlog_errno(status); | ||
1434 | goto bail; | ||
1435 | } | ||
1436 | 1412 | ||
1437 | *ret_new_eb_bh = new_eb_bh; | 1413 | *ret_new_eb_bh = new_eb_bh; |
1438 | new_eb_bh = NULL; | 1414 | new_eb_bh = NULL; |
@@ -2064,7 +2040,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle, | |||
2064 | struct ocfs2_path *right_path, | 2040 | struct ocfs2_path *right_path, |
2065 | int subtree_index) | 2041 | int subtree_index) |
2066 | { | 2042 | { |
2067 | int ret, i, idx; | 2043 | int i, idx; |
2068 | struct ocfs2_extent_list *el, *left_el, *right_el; | 2044 | struct ocfs2_extent_list *el, *left_el, *right_el; |
2069 | struct ocfs2_extent_rec *left_rec, *right_rec; | 2045 | struct ocfs2_extent_rec *left_rec, *right_rec; |
2070 | struct buffer_head *root_bh = left_path->p_node[subtree_index].bh; | 2046 | struct buffer_head *root_bh = left_path->p_node[subtree_index].bh; |
@@ -2102,13 +2078,8 @@ static void ocfs2_complete_edge_insert(handle_t *handle, | |||
2102 | ocfs2_adjust_adjacent_records(left_rec, left_el, right_rec, | 2078 | ocfs2_adjust_adjacent_records(left_rec, left_el, right_rec, |
2103 | right_el); | 2079 | right_el); |
2104 | 2080 | ||
2105 | ret = ocfs2_journal_dirty(handle, left_path->p_node[i].bh); | 2081 | ocfs2_journal_dirty(handle, left_path->p_node[i].bh); |
2106 | if (ret) | 2082 | ocfs2_journal_dirty(handle, right_path->p_node[i].bh); |
2107 | mlog_errno(ret); | ||
2108 | |||
2109 | ret = ocfs2_journal_dirty(handle, right_path->p_node[i].bh); | ||
2110 | if (ret) | ||
2111 | mlog_errno(ret); | ||
2112 | 2083 | ||
2113 | /* | 2084 | /* |
2114 | * Setup our list pointers now so that the current | 2085 | * Setup our list pointers now so that the current |
@@ -2132,9 +2103,7 @@ static void ocfs2_complete_edge_insert(handle_t *handle, | |||
2132 | 2103 | ||
2133 | root_bh = left_path->p_node[subtree_index].bh; | 2104 | root_bh = left_path->p_node[subtree_index].bh; |
2134 | 2105 | ||
2135 | ret = ocfs2_journal_dirty(handle, root_bh); | 2106 | ocfs2_journal_dirty(handle, root_bh); |
2136 | if (ret) | ||
2137 | mlog_errno(ret); | ||
2138 | } | 2107 | } |
2139 | 2108 | ||
2140 | static int ocfs2_rotate_subtree_right(handle_t *handle, | 2109 | static int ocfs2_rotate_subtree_right(handle_t *handle, |
@@ -2207,11 +2176,7 @@ static int ocfs2_rotate_subtree_right(handle_t *handle, | |||
2207 | 2176 | ||
2208 | ocfs2_create_empty_extent(right_el); | 2177 | ocfs2_create_empty_extent(right_el); |
2209 | 2178 | ||
2210 | ret = ocfs2_journal_dirty(handle, right_leaf_bh); | 2179 | ocfs2_journal_dirty(handle, right_leaf_bh); |
2211 | if (ret) { | ||
2212 | mlog_errno(ret); | ||
2213 | goto out; | ||
2214 | } | ||
2215 | 2180 | ||
2216 | /* Do the copy now. */ | 2181 | /* Do the copy now. */ |
2217 | i = le16_to_cpu(left_el->l_next_free_rec) - 1; | 2182 | i = le16_to_cpu(left_el->l_next_free_rec) - 1; |
@@ -2230,11 +2195,7 @@ static int ocfs2_rotate_subtree_right(handle_t *handle, | |||
2230 | memset(&left_el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec)); | 2195 | memset(&left_el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec)); |
2231 | le16_add_cpu(&left_el->l_next_free_rec, 1); | 2196 | le16_add_cpu(&left_el->l_next_free_rec, 1); |
2232 | 2197 | ||
2233 | ret = ocfs2_journal_dirty(handle, left_leaf_bh); | 2198 | ocfs2_journal_dirty(handle, left_leaf_bh); |
2234 | if (ret) { | ||
2235 | mlog_errno(ret); | ||
2236 | goto out; | ||
2237 | } | ||
2238 | 2199 | ||
2239 | ocfs2_complete_edge_insert(handle, left_path, right_path, | 2200 | ocfs2_complete_edge_insert(handle, left_path, right_path, |
2240 | subtree_index); | 2201 | subtree_index); |
@@ -2823,12 +2784,8 @@ static int ocfs2_rotate_subtree_left(handle_t *handle, | |||
2823 | ocfs2_remove_empty_extent(right_leaf_el); | 2784 | ocfs2_remove_empty_extent(right_leaf_el); |
2824 | } | 2785 | } |
2825 | 2786 | ||
2826 | ret = ocfs2_journal_dirty(handle, path_leaf_bh(left_path)); | 2787 | ocfs2_journal_dirty(handle, path_leaf_bh(left_path)); |
2827 | if (ret) | 2788 | ocfs2_journal_dirty(handle, path_leaf_bh(right_path)); |
2828 | mlog_errno(ret); | ||
2829 | ret = ocfs2_journal_dirty(handle, path_leaf_bh(right_path)); | ||
2830 | if (ret) | ||
2831 | mlog_errno(ret); | ||
2832 | 2789 | ||
2833 | if (del_right_subtree) { | 2790 | if (del_right_subtree) { |
2834 | ocfs2_unlink_subtree(handle, et, left_path, right_path, | 2791 | ocfs2_unlink_subtree(handle, et, left_path, right_path, |
@@ -2851,9 +2808,7 @@ static int ocfs2_rotate_subtree_left(handle_t *handle, | |||
2851 | if (right_has_empty) | 2808 | if (right_has_empty) |
2852 | ocfs2_remove_empty_extent(left_leaf_el); | 2809 | ocfs2_remove_empty_extent(left_leaf_el); |
2853 | 2810 | ||
2854 | ret = ocfs2_journal_dirty(handle, et_root_bh); | 2811 | ocfs2_journal_dirty(handle, et_root_bh); |
2855 | if (ret) | ||
2856 | mlog_errno(ret); | ||
2857 | 2812 | ||
2858 | *deleted = 1; | 2813 | *deleted = 1; |
2859 | } else | 2814 | } else |
@@ -2962,10 +2917,7 @@ static int ocfs2_rotate_rightmost_leaf_left(handle_t *handle, | |||
2962 | } | 2917 | } |
2963 | 2918 | ||
2964 | ocfs2_remove_empty_extent(el); | 2919 | ocfs2_remove_empty_extent(el); |
2965 | 2920 | ocfs2_journal_dirty(handle, bh); | |
2966 | ret = ocfs2_journal_dirty(handle, bh); | ||
2967 | if (ret) | ||
2968 | mlog_errno(ret); | ||
2969 | 2921 | ||
2970 | out: | 2922 | out: |
2971 | return ret; | 2923 | return ret; |
@@ -3506,15 +3458,9 @@ static int ocfs2_merge_rec_right(struct ocfs2_path *left_path, | |||
3506 | 3458 | ||
3507 | ocfs2_cleanup_merge(el, index); | 3459 | ocfs2_cleanup_merge(el, index); |
3508 | 3460 | ||
3509 | ret = ocfs2_journal_dirty(handle, bh); | 3461 | ocfs2_journal_dirty(handle, bh); |
3510 | if (ret) | ||
3511 | mlog_errno(ret); | ||
3512 | |||
3513 | if (right_path) { | 3462 | if (right_path) { |
3514 | ret = ocfs2_journal_dirty(handle, path_leaf_bh(right_path)); | 3463 | ocfs2_journal_dirty(handle, path_leaf_bh(right_path)); |
3515 | if (ret) | ||
3516 | mlog_errno(ret); | ||
3517 | |||
3518 | ocfs2_complete_edge_insert(handle, left_path, right_path, | 3464 | ocfs2_complete_edge_insert(handle, left_path, right_path, |
3519 | subtree_index); | 3465 | subtree_index); |
3520 | } | 3466 | } |
@@ -3683,14 +3629,9 @@ static int ocfs2_merge_rec_left(struct ocfs2_path *right_path, | |||
3683 | 3629 | ||
3684 | ocfs2_cleanup_merge(el, index); | 3630 | ocfs2_cleanup_merge(el, index); |
3685 | 3631 | ||
3686 | ret = ocfs2_journal_dirty(handle, bh); | 3632 | ocfs2_journal_dirty(handle, bh); |
3687 | if (ret) | ||
3688 | mlog_errno(ret); | ||
3689 | |||
3690 | if (left_path) { | 3633 | if (left_path) { |
3691 | ret = ocfs2_journal_dirty(handle, path_leaf_bh(left_path)); | 3634 | ocfs2_journal_dirty(handle, path_leaf_bh(left_path)); |
3692 | if (ret) | ||
3693 | mlog_errno(ret); | ||
3694 | 3635 | ||
3695 | /* | 3636 | /* |
3696 | * In the situation that the right_rec is empty and the extent | 3637 | * In the situation that the right_rec is empty and the extent |
@@ -4016,10 +3957,7 @@ static void ocfs2_adjust_rightmost_records(handle_t *handle, | |||
4016 | le32_add_cpu(&rec->e_int_clusters, | 3957 | le32_add_cpu(&rec->e_int_clusters, |
4017 | -le32_to_cpu(rec->e_cpos)); | 3958 | -le32_to_cpu(rec->e_cpos)); |
4018 | 3959 | ||
4019 | ret = ocfs2_journal_dirty(handle, bh); | 3960 | ocfs2_journal_dirty(handle, bh); |
4020 | if (ret) | ||
4021 | mlog_errno(ret); | ||
4022 | |||
4023 | } | 3961 | } |
4024 | } | 3962 | } |
4025 | 3963 | ||
@@ -4251,17 +4189,13 @@ static int ocfs2_insert_path(handle_t *handle, | |||
4251 | * dirty this for us. | 4189 | * dirty this for us. |
4252 | */ | 4190 | */ |
4253 | if (left_path) | 4191 | if (left_path) |
4254 | ret = ocfs2_journal_dirty(handle, | 4192 | ocfs2_journal_dirty(handle, |
4255 | path_leaf_bh(left_path)); | 4193 | path_leaf_bh(left_path)); |
4256 | if (ret) | ||
4257 | mlog_errno(ret); | ||
4258 | } else | 4194 | } else |
4259 | ocfs2_insert_at_leaf(et, insert_rec, path_leaf_el(right_path), | 4195 | ocfs2_insert_at_leaf(et, insert_rec, path_leaf_el(right_path), |
4260 | insert); | 4196 | insert); |
4261 | 4197 | ||
4262 | ret = ocfs2_journal_dirty(handle, leaf_bh); | 4198 | ocfs2_journal_dirty(handle, leaf_bh); |
4263 | if (ret) | ||
4264 | mlog_errno(ret); | ||
4265 | 4199 | ||
4266 | if (left_path) { | 4200 | if (left_path) { |
4267 | /* | 4201 | /* |
@@ -4384,9 +4318,7 @@ out_update_clusters: | |||
4384 | ocfs2_et_update_clusters(et, | 4318 | ocfs2_et_update_clusters(et, |
4385 | le16_to_cpu(insert_rec->e_leaf_clusters)); | 4319 | le16_to_cpu(insert_rec->e_leaf_clusters)); |
4386 | 4320 | ||
4387 | ret = ocfs2_journal_dirty(handle, et->et_root_bh); | 4321 | ocfs2_journal_dirty(handle, et->et_root_bh); |
4388 | if (ret) | ||
4389 | mlog_errno(ret); | ||
4390 | 4322 | ||
4391 | out: | 4323 | out: |
4392 | ocfs2_free_path(left_path); | 4324 | ocfs2_free_path(left_path); |
@@ -4895,11 +4827,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4895 | goto leave; | 4827 | goto leave; |
4896 | } | 4828 | } |
4897 | 4829 | ||
4898 | status = ocfs2_journal_dirty(handle, et->et_root_bh); | 4830 | ocfs2_journal_dirty(handle, et->et_root_bh); |
4899 | if (status < 0) { | ||
4900 | mlog_errno(status); | ||
4901 | goto leave; | ||
4902 | } | ||
4903 | 4831 | ||
4904 | clusters_to_add -= num_bits; | 4832 | clusters_to_add -= num_bits; |
4905 | *logical_offset += num_bits; | 4833 | *logical_offset += num_bits; |
@@ -5724,11 +5652,7 @@ int ocfs2_remove_btree_range(struct inode *inode, | |||
5724 | 5652 | ||
5725 | ocfs2_et_update_clusters(et, -len); | 5653 | ocfs2_et_update_clusters(et, -len); |
5726 | 5654 | ||
5727 | ret = ocfs2_journal_dirty(handle, et->et_root_bh); | 5655 | ocfs2_journal_dirty(handle, et->et_root_bh); |
5728 | if (ret) { | ||
5729 | mlog_errno(ret); | ||
5730 | goto out_commit; | ||
5731 | } | ||
5732 | 5656 | ||
5733 | ret = ocfs2_truncate_log_append(osb, handle, phys_blkno, len); | 5657 | ret = ocfs2_truncate_log_append(osb, handle, phys_blkno, len); |
5734 | if (ret) | 5658 | if (ret) |
@@ -5850,11 +5774,7 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb, | |||
5850 | } | 5774 | } |
5851 | tl->tl_recs[index].t_clusters = cpu_to_le32(num_clusters); | 5775 | tl->tl_recs[index].t_clusters = cpu_to_le32(num_clusters); |
5852 | 5776 | ||
5853 | status = ocfs2_journal_dirty(handle, tl_bh); | 5777 | ocfs2_journal_dirty(handle, tl_bh); |
5854 | if (status < 0) { | ||
5855 | mlog_errno(status); | ||
5856 | goto bail; | ||
5857 | } | ||
5858 | 5778 | ||
5859 | bail: | 5779 | bail: |
5860 | mlog_exit(status); | 5780 | mlog_exit(status); |
@@ -5893,11 +5813,7 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, | |||
5893 | 5813 | ||
5894 | tl->tl_used = cpu_to_le16(i); | 5814 | tl->tl_used = cpu_to_le16(i); |
5895 | 5815 | ||
5896 | status = ocfs2_journal_dirty(handle, tl_bh); | 5816 | ocfs2_journal_dirty(handle, tl_bh); |
5897 | if (status < 0) { | ||
5898 | mlog_errno(status); | ||
5899 | goto bail; | ||
5900 | } | ||
5901 | 5817 | ||
5902 | /* TODO: Perhaps we can calculate the bulk of the | 5818 | /* TODO: Perhaps we can calculate the bulk of the |
5903 | * credits up front rather than extending like | 5819 | * credits up front rather than extending like |
@@ -6824,11 +6740,7 @@ find_tail_record: | |||
6824 | } | 6740 | } |
6825 | 6741 | ||
6826 | delete: | 6742 | delete: |
6827 | ret = ocfs2_journal_dirty(handle, bh); | 6743 | ocfs2_journal_dirty(handle, bh); |
6828 | if (ret) { | ||
6829 | mlog_errno(ret); | ||
6830 | goto out; | ||
6831 | } | ||
6832 | 6744 | ||
6833 | mlog(0, "extent list container %llu, after: record %d: " | 6745 | mlog(0, "extent list container %llu, after: record %d: " |
6834 | "(%u, %u, %llu), next = %u.\n", | 6746 | "(%u, %u, %llu), next = %u.\n", |
@@ -6959,22 +6871,14 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, | |||
6959 | } else if (last_eb) | 6871 | } else if (last_eb) |
6960 | fe->i_last_eb_blk = last_eb->h_blkno; | 6872 | fe->i_last_eb_blk = last_eb->h_blkno; |
6961 | 6873 | ||
6962 | status = ocfs2_journal_dirty(handle, fe_bh); | 6874 | ocfs2_journal_dirty(handle, fe_bh); |
6963 | if (status < 0) { | ||
6964 | mlog_errno(status); | ||
6965 | goto bail; | ||
6966 | } | ||
6967 | 6875 | ||
6968 | if (last_eb) { | 6876 | if (last_eb) { |
6969 | /* If there will be a new last extent block, then by | 6877 | /* If there will be a new last extent block, then by |
6970 | * definition, there cannot be any leaves to the right of | 6878 | * definition, there cannot be any leaves to the right of |
6971 | * him. */ | 6879 | * him. */ |
6972 | last_eb->h_next_leaf_blk = 0; | 6880 | last_eb->h_next_leaf_blk = 0; |
6973 | status = ocfs2_journal_dirty(handle, last_eb_bh); | 6881 | ocfs2_journal_dirty(handle, last_eb_bh); |
6974 | if (status < 0) { | ||
6975 | mlog_errno(status); | ||
6976 | goto bail; | ||
6977 | } | ||
6978 | } | 6882 | } |
6979 | 6883 | ||
6980 | if (delete_blk) { | 6884 | if (delete_blk) { |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index efd77d071c80..6d832487c187 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -1194,7 +1194,7 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir, | |||
1194 | else | 1194 | else |
1195 | de->inode = 0; | 1195 | de->inode = 0; |
1196 | dir->i_version++; | 1196 | dir->i_version++; |
1197 | status = ocfs2_journal_dirty(handle, bh); | 1197 | ocfs2_journal_dirty(handle, bh); |
1198 | goto bail; | 1198 | goto bail; |
1199 | } | 1199 | } |
1200 | i += le16_to_cpu(de->rec_len); | 1200 | i += le16_to_cpu(de->rec_len); |
@@ -1752,7 +1752,7 @@ int __ocfs2_add_entry(handle_t *handle, | |||
1752 | ocfs2_recalc_free_list(dir, handle, lookup); | 1752 | ocfs2_recalc_free_list(dir, handle, lookup); |
1753 | 1753 | ||
1754 | dir->i_version++; | 1754 | dir->i_version++; |
1755 | status = ocfs2_journal_dirty(handle, insert_bh); | 1755 | ocfs2_journal_dirty(handle, insert_bh); |
1756 | retval = 0; | 1756 | retval = 0; |
1757 | goto bail; | 1757 | goto bail; |
1758 | } | 1758 | } |
@@ -2297,12 +2297,7 @@ static int ocfs2_fill_new_dir_id(struct ocfs2_super *osb, | |||
2297 | } | 2297 | } |
2298 | 2298 | ||
2299 | ocfs2_fill_initial_dirents(inode, parent, data->id_data, size); | 2299 | ocfs2_fill_initial_dirents(inode, parent, data->id_data, size); |
2300 | |||
2301 | ocfs2_journal_dirty(handle, di_bh); | 2300 | ocfs2_journal_dirty(handle, di_bh); |
2302 | if (ret) { | ||
2303 | mlog_errno(ret); | ||
2304 | goto out; | ||
2305 | } | ||
2306 | 2301 | ||
2307 | i_size_write(inode, size); | 2302 | i_size_write(inode, size); |
2308 | inode->i_nlink = 2; | 2303 | inode->i_nlink = 2; |
@@ -2366,11 +2361,7 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb, | |||
2366 | ocfs2_init_dir_trailer(inode, new_bh, size); | 2361 | ocfs2_init_dir_trailer(inode, new_bh, size); |
2367 | } | 2362 | } |
2368 | 2363 | ||
2369 | status = ocfs2_journal_dirty(handle, new_bh); | 2364 | ocfs2_journal_dirty(handle, new_bh); |
2370 | if (status < 0) { | ||
2371 | mlog_errno(status); | ||
2372 | goto bail; | ||
2373 | } | ||
2374 | 2365 | ||
2375 | i_size_write(inode, inode->i_sb->s_blocksize); | 2366 | i_size_write(inode, inode->i_sb->s_blocksize); |
2376 | inode->i_nlink = 2; | 2367 | inode->i_nlink = 2; |
@@ -2458,10 +2449,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, | |||
2458 | dx_root->dr_list.l_count = | 2449 | dx_root->dr_list.l_count = |
2459 | cpu_to_le16(ocfs2_extent_recs_per_dx_root(osb->sb)); | 2450 | cpu_to_le16(ocfs2_extent_recs_per_dx_root(osb->sb)); |
2460 | } | 2451 | } |
2461 | 2452 | ocfs2_journal_dirty(handle, dx_root_bh); | |
2462 | ret = ocfs2_journal_dirty(handle, dx_root_bh); | ||
2463 | if (ret) | ||
2464 | mlog_errno(ret); | ||
2465 | 2453 | ||
2466 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, | 2454 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(dir), di_bh, |
2467 | OCFS2_JOURNAL_ACCESS_CREATE); | 2455 | OCFS2_JOURNAL_ACCESS_CREATE); |
@@ -2475,9 +2463,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, | |||
2475 | OCFS2_I(dir)->ip_dyn_features |= OCFS2_INDEXED_DIR_FL; | 2463 | OCFS2_I(dir)->ip_dyn_features |= OCFS2_INDEXED_DIR_FL; |
2476 | di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features); | 2464 | di->i_dyn_features = cpu_to_le16(OCFS2_I(dir)->ip_dyn_features); |
2477 | 2465 | ||
2478 | ret = ocfs2_journal_dirty(handle, di_bh); | 2466 | ocfs2_journal_dirty(handle, di_bh); |
2479 | if (ret) | ||
2480 | mlog_errno(ret); | ||
2481 | 2467 | ||
2482 | *ret_dx_root_bh = dx_root_bh; | 2468 | *ret_dx_root_bh = dx_root_bh; |
2483 | dx_root_bh = NULL; | 2469 | dx_root_bh = NULL; |
@@ -3034,11 +3020,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
3034 | ocfs2_init_dir_trailer(dir, dirdata_bh, i); | 3020 | ocfs2_init_dir_trailer(dir, dirdata_bh, i); |
3035 | } | 3021 | } |
3036 | 3022 | ||
3037 | ret = ocfs2_journal_dirty(handle, dirdata_bh); | 3023 | ocfs2_journal_dirty(handle, dirdata_bh); |
3038 | if (ret) { | ||
3039 | mlog_errno(ret); | ||
3040 | goto out_commit; | ||
3041 | } | ||
3042 | 3024 | ||
3043 | if (ocfs2_supports_indexed_dirs(osb) && !dx_inline) { | 3025 | if (ocfs2_supports_indexed_dirs(osb) && !dx_inline) { |
3044 | /* | 3026 | /* |
@@ -3104,11 +3086,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
3104 | */ | 3086 | */ |
3105 | dir->i_blocks = ocfs2_inode_sector_count(dir); | 3087 | dir->i_blocks = ocfs2_inode_sector_count(dir); |
3106 | 3088 | ||
3107 | ret = ocfs2_journal_dirty(handle, di_bh); | 3089 | ocfs2_journal_dirty(handle, di_bh); |
3108 | if (ret) { | ||
3109 | mlog_errno(ret); | ||
3110 | goto out_commit; | ||
3111 | } | ||
3112 | 3090 | ||
3113 | if (ocfs2_supports_indexed_dirs(osb)) { | 3091 | if (ocfs2_supports_indexed_dirs(osb)) { |
3114 | ret = ocfs2_dx_dir_attach_index(osb, handle, dir, di_bh, | 3092 | ret = ocfs2_dx_dir_attach_index(osb, handle, dir, di_bh, |
@@ -3423,11 +3401,7 @@ do_extend: | |||
3423 | } else { | 3401 | } else { |
3424 | de->rec_len = cpu_to_le16(sb->s_blocksize); | 3402 | de->rec_len = cpu_to_le16(sb->s_blocksize); |
3425 | } | 3403 | } |
3426 | status = ocfs2_journal_dirty(handle, new_bh); | 3404 | ocfs2_journal_dirty(handle, new_bh); |
3427 | if (status < 0) { | ||
3428 | mlog_errno(status); | ||
3429 | goto bail; | ||
3430 | } | ||
3431 | 3405 | ||
3432 | dir_i_size += dir->i_sb->s_blocksize; | 3406 | dir_i_size += dir->i_sb->s_blocksize; |
3433 | i_size_write(dir, dir_i_size); | 3407 | i_size_write(dir, dir_i_size); |
@@ -3906,11 +3880,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, | |||
3906 | sizeof(struct ocfs2_dx_entry), dx_leaf_sort_cmp, | 3880 | sizeof(struct ocfs2_dx_entry), dx_leaf_sort_cmp, |
3907 | dx_leaf_sort_swap); | 3881 | dx_leaf_sort_swap); |
3908 | 3882 | ||
3909 | ret = ocfs2_journal_dirty(handle, dx_leaf_bh); | 3883 | ocfs2_journal_dirty(handle, dx_leaf_bh); |
3910 | if (ret) { | ||
3911 | mlog_errno(ret); | ||
3912 | goto out_commit; | ||
3913 | } | ||
3914 | 3884 | ||
3915 | ret = ocfs2_dx_dir_find_leaf_split(dx_leaf, leaf_cpos, insert_hash, | 3885 | ret = ocfs2_dx_dir_find_leaf_split(dx_leaf, leaf_cpos, insert_hash, |
3916 | &split_hash); | 3886 | &split_hash); |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 17947dc8341e..e6e8281628a6 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -278,10 +278,7 @@ int ocfs2_update_inode_atime(struct inode *inode, | |||
278 | inode->i_atime = CURRENT_TIME; | 278 | inode->i_atime = CURRENT_TIME; |
279 | di->i_atime = cpu_to_le64(inode->i_atime.tv_sec); | 279 | di->i_atime = cpu_to_le64(inode->i_atime.tv_sec); |
280 | di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); | 280 | di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); |
281 | 281 | ocfs2_journal_dirty(handle, bh); | |
282 | ret = ocfs2_journal_dirty(handle, bh); | ||
283 | if (ret < 0) | ||
284 | mlog_errno(ret); | ||
285 | 282 | ||
286 | out_commit: | 283 | out_commit: |
287 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); | 284 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); |
@@ -430,9 +427,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, | |||
430 | di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); | 427 | di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); |
431 | di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | 428 | di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); |
432 | 429 | ||
433 | status = ocfs2_journal_dirty(handle, fe_bh); | 430 | ocfs2_journal_dirty(handle, fe_bh); |
434 | if (status < 0) | ||
435 | mlog_errno(status); | ||
436 | 431 | ||
437 | out_commit: | 432 | out_commit: |
438 | ocfs2_commit_trans(osb, handle); | 433 | ocfs2_commit_trans(osb, handle); |
@@ -666,11 +661,7 @@ restarted_transaction: | |||
666 | goto leave; | 661 | goto leave; |
667 | } | 662 | } |
668 | 663 | ||
669 | status = ocfs2_journal_dirty(handle, bh); | 664 | ocfs2_journal_dirty(handle, bh); |
670 | if (status < 0) { | ||
671 | mlog_errno(status); | ||
672 | goto leave; | ||
673 | } | ||
674 | 665 | ||
675 | spin_lock(&OCFS2_I(inode)->ip_lock); | 666 | spin_lock(&OCFS2_I(inode)->ip_lock); |
676 | clusters_to_add -= (OCFS2_I(inode)->ip_clusters - prev_clusters); | 667 | clusters_to_add -= (OCFS2_I(inode)->ip_clusters - prev_clusters); |
@@ -1194,9 +1185,7 @@ static int __ocfs2_write_remove_suid(struct inode *inode, | |||
1194 | di = (struct ocfs2_dinode *) bh->b_data; | 1185 | di = (struct ocfs2_dinode *) bh->b_data; |
1195 | di->i_mode = cpu_to_le16(inode->i_mode); | 1186 | di->i_mode = cpu_to_le16(inode->i_mode); |
1196 | 1187 | ||
1197 | ret = ocfs2_journal_dirty(handle, bh); | 1188 | ocfs2_journal_dirty(handle, bh); |
1198 | if (ret < 0) | ||
1199 | mlog_errno(ret); | ||
1200 | 1189 | ||
1201 | out_trans: | 1190 | out_trans: |
1202 | ocfs2_commit_trans(osb, handle); | 1191 | ocfs2_commit_trans(osb, handle); |
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 278a223aae14..7cc0b4665d5e 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -657,12 +657,7 @@ static int ocfs2_remove_inode(struct inode *inode, | |||
657 | 657 | ||
658 | di->i_dtime = cpu_to_le64(CURRENT_TIME.tv_sec); | 658 | di->i_dtime = cpu_to_le64(CURRENT_TIME.tv_sec); |
659 | di->i_flags &= cpu_to_le32(~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL)); | 659 | di->i_flags &= cpu_to_le32(~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL)); |
660 | 660 | ocfs2_journal_dirty(handle, di_bh); | |
661 | status = ocfs2_journal_dirty(handle, di_bh); | ||
662 | if (status < 0) { | ||
663 | mlog_errno(status); | ||
664 | goto bail_commit; | ||
665 | } | ||
666 | 661 | ||
667 | ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); | 662 | ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); |
668 | dquot_free_inode(inode); | 663 | dquot_free_inode(inode); |
@@ -1276,13 +1271,8 @@ int ocfs2_mark_inode_dirty(handle_t *handle, | |||
1276 | fe->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); | 1271 | fe->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); |
1277 | fe->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); | 1272 | fe->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); |
1278 | 1273 | ||
1279 | status = ocfs2_journal_dirty(handle, bh); | 1274 | ocfs2_journal_dirty(handle, bh); |
1280 | if (status < 0) | ||
1281 | mlog_errno(status); | ||
1282 | |||
1283 | status = 0; | ||
1284 | leave: | 1275 | leave: |
1285 | |||
1286 | mlog_exit(status); | 1276 | mlog_exit(status); |
1287 | return status; | 1277 | return status; |
1288 | } | 1278 | } |
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 9336c60e3a36..cfd271c64da9 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -734,8 +734,7 @@ int ocfs2_journal_access(handle_t *handle, struct ocfs2_caching_info *ci, | |||
734 | return __ocfs2_journal_access(handle, ci, bh, NULL, type); | 734 | return __ocfs2_journal_access(handle, ci, bh, NULL, type); |
735 | } | 735 | } |
736 | 736 | ||
737 | int ocfs2_journal_dirty(handle_t *handle, | 737 | void ocfs2_journal_dirty(handle_t *handle, struct buffer_head *bh) |
738 | struct buffer_head *bh) | ||
739 | { | 738 | { |
740 | int status; | 739 | int status; |
741 | 740 | ||
@@ -743,13 +742,9 @@ int ocfs2_journal_dirty(handle_t *handle, | |||
743 | (unsigned long long)bh->b_blocknr); | 742 | (unsigned long long)bh->b_blocknr); |
744 | 743 | ||
745 | status = jbd2_journal_dirty_metadata(handle, bh); | 744 | status = jbd2_journal_dirty_metadata(handle, bh); |
746 | if (status < 0) | 745 | BUG_ON(status); |
747 | mlog(ML_ERROR, "Could not dirty metadata buffer. " | ||
748 | "(bh->b_blocknr=%llu)\n", | ||
749 | (unsigned long long)bh->b_blocknr); | ||
750 | 746 | ||
751 | mlog_exit(status); | 747 | mlog_exit_void(); |
752 | return status; | ||
753 | } | 748 | } |
754 | 749 | ||
755 | #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE) | 750 | #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE) |
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 3f74e09b0d80..7dc56561c9ae 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h | |||
@@ -325,8 +325,7 @@ int ocfs2_journal_access(handle_t *handle, struct ocfs2_caching_info *ci, | |||
325 | * <modify the bh> | 325 | * <modify the bh> |
326 | * ocfs2_journal_dirty(handle, bh); | 326 | * ocfs2_journal_dirty(handle, bh); |
327 | */ | 327 | */ |
328 | int ocfs2_journal_dirty(handle_t *handle, | 328 | void ocfs2_journal_dirty(handle_t *handle, struct buffer_head *bh); |
329 | struct buffer_head *bh); | ||
330 | 329 | ||
331 | /* | 330 | /* |
332 | * Credit Macros: | 331 | * Credit Macros: |
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index c983715d8d8c..7e7dd65d97ef 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c | |||
@@ -305,12 +305,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb) | |||
305 | } | 305 | } |
306 | 306 | ||
307 | ocfs2_clear_local_alloc(alloc); | 307 | ocfs2_clear_local_alloc(alloc); |
308 | 308 | ocfs2_journal_dirty(handle, bh); | |
309 | status = ocfs2_journal_dirty(handle, bh); | ||
310 | if (status < 0) { | ||
311 | mlog_errno(status); | ||
312 | goto out_commit; | ||
313 | } | ||
314 | 309 | ||
315 | brelse(bh); | 310 | brelse(bh); |
316 | osb->local_alloc_bh = NULL; | 311 | osb->local_alloc_bh = NULL; |
@@ -691,14 +686,8 @@ int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb, | |||
691 | ocfs2_set_bit(start++, bitmap); | 686 | ocfs2_set_bit(start++, bitmap); |
692 | 687 | ||
693 | le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); | 688 | le32_add_cpu(&alloc->id1.bitmap1.i_used, *num_bits); |
689 | ocfs2_journal_dirty(handle, osb->local_alloc_bh); | ||
694 | 690 | ||
695 | status = ocfs2_journal_dirty(handle, osb->local_alloc_bh); | ||
696 | if (status < 0) { | ||
697 | mlog_errno(status); | ||
698 | goto bail; | ||
699 | } | ||
700 | |||
701 | status = 0; | ||
702 | bail: | 691 | bail: |
703 | mlog_exit(status); | 692 | mlog_exit(status); |
704 | return status; | 693 | return status; |
@@ -1169,12 +1158,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, | |||
1169 | } | 1158 | } |
1170 | 1159 | ||
1171 | ocfs2_clear_local_alloc(alloc); | 1160 | ocfs2_clear_local_alloc(alloc); |
1172 | 1161 | ocfs2_journal_dirty(handle, osb->local_alloc_bh); | |
1173 | status = ocfs2_journal_dirty(handle, osb->local_alloc_bh); | ||
1174 | if (status < 0) { | ||
1175 | mlog_errno(status); | ||
1176 | goto bail; | ||
1177 | } | ||
1178 | 1162 | ||
1179 | status = ocfs2_sync_local_to_main(osb, handle, alloc_copy, | 1163 | status = ocfs2_sync_local_to_main(osb, handle, alloc_copy, |
1180 | main_bm_inode, main_bm_bh); | 1164 | main_bm_inode, main_bm_bh); |
@@ -1192,7 +1176,6 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, | |||
1192 | 1176 | ||
1193 | atomic_inc(&osb->alloc_stats.moves); | 1177 | atomic_inc(&osb->alloc_stats.moves); |
1194 | 1178 | ||
1195 | status = 0; | ||
1196 | bail: | 1179 | bail: |
1197 | if (handle) | 1180 | if (handle) |
1198 | ocfs2_commit_trans(osb, handle); | 1181 | ocfs2_commit_trans(osb, handle); |
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index d9cd4e373a53..21d4a33d0f0e 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -384,11 +384,7 @@ static int ocfs2_mknod(struct inode *dir, | |||
384 | goto leave; | 384 | goto leave; |
385 | } | 385 | } |
386 | ocfs2_add_links_count(dirfe, 1); | 386 | ocfs2_add_links_count(dirfe, 1); |
387 | status = ocfs2_journal_dirty(handle, parent_fe_bh); | 387 | ocfs2_journal_dirty(handle, parent_fe_bh); |
388 | if (status < 0) { | ||
389 | mlog_errno(status); | ||
390 | goto leave; | ||
391 | } | ||
392 | inc_nlink(dir); | 388 | inc_nlink(dir); |
393 | } | 389 | } |
394 | 390 | ||
@@ -556,11 +552,7 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, | |||
556 | fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb)); | 552 | fel->l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(osb->sb)); |
557 | } | 553 | } |
558 | 554 | ||
559 | status = ocfs2_journal_dirty(handle, *new_fe_bh); | 555 | ocfs2_journal_dirty(handle, *new_fe_bh); |
560 | if (status < 0) { | ||
561 | mlog_errno(status); | ||
562 | goto leave; | ||
563 | } | ||
564 | 556 | ||
565 | ocfs2_populate_inode(inode, fe, 1); | 557 | ocfs2_populate_inode(inode, fe, 1); |
566 | ocfs2_ci_set_new(osb, INODE_CACHE(inode)); | 558 | ocfs2_ci_set_new(osb, INODE_CACHE(inode)); |
@@ -694,14 +686,7 @@ static int ocfs2_link(struct dentry *old_dentry, | |||
694 | ocfs2_set_links_count(fe, inode->i_nlink); | 686 | ocfs2_set_links_count(fe, inode->i_nlink); |
695 | fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); | 687 | fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); |
696 | fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); | 688 | fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); |
697 | 689 | ocfs2_journal_dirty(handle, fe_bh); | |
698 | err = ocfs2_journal_dirty(handle, fe_bh); | ||
699 | if (err < 0) { | ||
700 | ocfs2_add_links_count(fe, -1); | ||
701 | drop_nlink(inode); | ||
702 | mlog_errno(err); | ||
703 | goto out_commit; | ||
704 | } | ||
705 | 690 | ||
706 | err = ocfs2_add_entry(handle, dentry, inode, | 691 | err = ocfs2_add_entry(handle, dentry, inode, |
707 | OCFS2_I(inode)->ip_blkno, | 692 | OCFS2_I(inode)->ip_blkno, |
@@ -898,12 +883,7 @@ static int ocfs2_unlink(struct inode *dir, | |||
898 | drop_nlink(inode); | 883 | drop_nlink(inode); |
899 | drop_nlink(inode); | 884 | drop_nlink(inode); |
900 | ocfs2_set_links_count(fe, inode->i_nlink); | 885 | ocfs2_set_links_count(fe, inode->i_nlink); |
901 | 886 | ocfs2_journal_dirty(handle, fe_bh); | |
902 | status = ocfs2_journal_dirty(handle, fe_bh); | ||
903 | if (status < 0) { | ||
904 | mlog_errno(status); | ||
905 | goto leave; | ||
906 | } | ||
907 | 887 | ||
908 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; | 888 | dir->i_ctime = dir->i_mtime = CURRENT_TIME; |
909 | if (S_ISDIR(inode->i_mode)) | 889 | if (S_ISDIR(inode->i_mode)) |
@@ -1321,12 +1301,7 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1321 | ocfs2_set_links_count(newfe, 0); | 1301 | ocfs2_set_links_count(newfe, 0); |
1322 | else | 1302 | else |
1323 | ocfs2_add_links_count(newfe, -1); | 1303 | ocfs2_add_links_count(newfe, -1); |
1324 | 1304 | ocfs2_journal_dirty(handle, newfe_bh); | |
1325 | status = ocfs2_journal_dirty(handle, newfe_bh); | ||
1326 | if (status < 0) { | ||
1327 | mlog_errno(status); | ||
1328 | goto bail; | ||
1329 | } | ||
1330 | } else { | 1305 | } else { |
1331 | /* if the name was not found in new_dir, add it now */ | 1306 | /* if the name was not found in new_dir, add it now */ |
1332 | status = ocfs2_add_entry(handle, new_dentry, old_inode, | 1307 | status = ocfs2_add_entry(handle, new_dentry, old_inode, |
@@ -1345,10 +1320,7 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1345 | 1320 | ||
1346 | old_di->i_ctime = cpu_to_le64(old_inode->i_ctime.tv_sec); | 1321 | old_di->i_ctime = cpu_to_le64(old_inode->i_ctime.tv_sec); |
1347 | old_di->i_ctime_nsec = cpu_to_le32(old_inode->i_ctime.tv_nsec); | 1322 | old_di->i_ctime_nsec = cpu_to_le32(old_inode->i_ctime.tv_nsec); |
1348 | 1323 | ocfs2_journal_dirty(handle, old_inode_bh); | |
1349 | status = ocfs2_journal_dirty(handle, old_inode_bh); | ||
1350 | if (status < 0) | ||
1351 | mlog_errno(status); | ||
1352 | } else | 1324 | } else |
1353 | mlog_errno(status); | 1325 | mlog_errno(status); |
1354 | 1326 | ||
@@ -1420,7 +1392,7 @@ static int ocfs2_rename(struct inode *old_dir, | |||
1420 | OCFS2_JOURNAL_ACCESS_WRITE); | 1392 | OCFS2_JOURNAL_ACCESS_WRITE); |
1421 | fe = (struct ocfs2_dinode *) old_dir_bh->b_data; | 1393 | fe = (struct ocfs2_dinode *) old_dir_bh->b_data; |
1422 | ocfs2_set_links_count(fe, old_dir->i_nlink); | 1394 | ocfs2_set_links_count(fe, old_dir->i_nlink); |
1423 | status = ocfs2_journal_dirty(handle, old_dir_bh); | 1395 | ocfs2_journal_dirty(handle, old_dir_bh); |
1424 | } | 1396 | } |
1425 | } | 1397 | } |
1426 | ocfs2_dentry_move(old_dentry, new_dentry, old_dir, new_dir); | 1398 | ocfs2_dentry_move(old_dentry, new_dentry, old_dir, new_dir); |
@@ -1552,11 +1524,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, | |||
1552 | (bytes_left > sb->s_blocksize) ? sb->s_blocksize : | 1524 | (bytes_left > sb->s_blocksize) ? sb->s_blocksize : |
1553 | bytes_left); | 1525 | bytes_left); |
1554 | 1526 | ||
1555 | status = ocfs2_journal_dirty(handle, bhs[virtual]); | 1527 | ocfs2_journal_dirty(handle, bhs[virtual]); |
1556 | if (status < 0) { | ||
1557 | mlog_errno(status); | ||
1558 | goto bail; | ||
1559 | } | ||
1560 | 1528 | ||
1561 | virtual++; | 1529 | virtual++; |
1562 | p_blkno++; | 1530 | p_blkno++; |
@@ -1943,12 +1911,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb, | |||
1943 | if (S_ISDIR(inode->i_mode)) | 1911 | if (S_ISDIR(inode->i_mode)) |
1944 | ocfs2_add_links_count(orphan_fe, 1); | 1912 | ocfs2_add_links_count(orphan_fe, 1); |
1945 | orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); | 1913 | orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); |
1946 | 1914 | ocfs2_journal_dirty(handle, orphan_dir_bh); | |
1947 | status = ocfs2_journal_dirty(handle, orphan_dir_bh); | ||
1948 | if (status < 0) { | ||
1949 | mlog_errno(status); | ||
1950 | goto leave; | ||
1951 | } | ||
1952 | 1915 | ||
1953 | status = __ocfs2_add_entry(handle, orphan_dir_inode, name, | 1916 | status = __ocfs2_add_entry(handle, orphan_dir_inode, name, |
1954 | OCFS2_ORPHAN_NAMELEN, inode, | 1917 | OCFS2_ORPHAN_NAMELEN, inode, |
@@ -2029,12 +1992,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
2029 | if (S_ISDIR(inode->i_mode)) | 1992 | if (S_ISDIR(inode->i_mode)) |
2030 | ocfs2_add_links_count(orphan_fe, -1); | 1993 | ocfs2_add_links_count(orphan_fe, -1); |
2031 | orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); | 1994 | orphan_dir_inode->i_nlink = ocfs2_read_links_count(orphan_fe); |
2032 | 1995 | ocfs2_journal_dirty(handle, orphan_dir_bh); | |
2033 | status = ocfs2_journal_dirty(handle, orphan_dir_bh); | ||
2034 | if (status < 0) { | ||
2035 | mlog_errno(status); | ||
2036 | goto leave; | ||
2037 | } | ||
2038 | 1996 | ||
2039 | leave: | 1997 | leave: |
2040 | ocfs2_free_dir_lookup_result(&lookup); | 1998 | ocfs2_free_dir_lookup_result(&lookup); |
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 355f41d1d520..faaa4d072c9a 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -260,10 +260,8 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type, | |||
260 | brelse(bh); | 260 | brelse(bh); |
261 | goto out; | 261 | goto out; |
262 | } | 262 | } |
263 | err = ocfs2_journal_dirty(handle, bh); | 263 | ocfs2_journal_dirty(handle, bh); |
264 | brelse(bh); | 264 | brelse(bh); |
265 | if (err < 0) | ||
266 | goto out; | ||
267 | out: | 265 | out: |
268 | if (err) { | 266 | if (err) { |
269 | mutex_unlock(&gqinode->i_mutex); | 267 | mutex_unlock(&gqinode->i_mutex); |
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index a6467f3d262e..a8f4cea1b824 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -118,12 +118,8 @@ static int ocfs2_modify_bh(struct inode *inode, struct buffer_head *bh, | |||
118 | lock_buffer(bh); | 118 | lock_buffer(bh); |
119 | modify(bh, private); | 119 | modify(bh, private); |
120 | unlock_buffer(bh); | 120 | unlock_buffer(bh); |
121 | status = ocfs2_journal_dirty(handle, bh); | 121 | ocfs2_journal_dirty(handle, bh); |
122 | if (status < 0) { | 122 | |
123 | mlog_errno(status); | ||
124 | ocfs2_commit_trans(OCFS2_SB(sb), handle); | ||
125 | return status; | ||
126 | } | ||
127 | status = ocfs2_commit_trans(OCFS2_SB(sb), handle); | 123 | status = ocfs2_commit_trans(OCFS2_SB(sb), handle); |
128 | if (status < 0) { | 124 | if (status < 0) { |
129 | mlog_errno(status); | 125 | mlog_errno(status); |
@@ -522,9 +518,7 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, | |||
522 | ocfs2_clear_bit(bit, dchunk->dqc_bitmap); | 518 | ocfs2_clear_bit(bit, dchunk->dqc_bitmap); |
523 | le32_add_cpu(&dchunk->dqc_free, 1); | 519 | le32_add_cpu(&dchunk->dqc_free, 1); |
524 | unlock_buffer(qbh); | 520 | unlock_buffer(qbh); |
525 | status = ocfs2_journal_dirty(handle, qbh); | 521 | ocfs2_journal_dirty(handle, qbh); |
526 | if (status < 0) | ||
527 | mlog_errno(status); | ||
528 | out_commit: | 522 | out_commit: |
529 | mutex_unlock(&sb_dqopt(sb)->dqio_mutex); | 523 | mutex_unlock(&sb_dqopt(sb)->dqio_mutex); |
530 | ocfs2_commit_trans(OCFS2_SB(sb), handle); | 524 | ocfs2_commit_trans(OCFS2_SB(sb), handle); |
@@ -630,9 +624,7 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb, | |||
630 | lock_buffer(bh); | 624 | lock_buffer(bh); |
631 | ldinfo->dqi_flags = cpu_to_le32(flags | OLQF_CLEAN); | 625 | ldinfo->dqi_flags = cpu_to_le32(flags | OLQF_CLEAN); |
632 | unlock_buffer(bh); | 626 | unlock_buffer(bh); |
633 | status = ocfs2_journal_dirty(handle, bh); | 627 | ocfs2_journal_dirty(handle, bh); |
634 | if (status < 0) | ||
635 | mlog_errno(status); | ||
636 | out_trans: | 628 | out_trans: |
637 | ocfs2_commit_trans(osb, handle); | 629 | ocfs2_commit_trans(osb, handle); |
638 | out_bh: | 630 | out_bh: |
@@ -1008,11 +1000,7 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( | |||
1008 | sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) - | 1000 | sb->s_blocksize - sizeof(struct ocfs2_local_disk_chunk) - |
1009 | OCFS2_QBLK_RESERVED_SPACE); | 1001 | OCFS2_QBLK_RESERVED_SPACE); |
1010 | unlock_buffer(bh); | 1002 | unlock_buffer(bh); |
1011 | status = ocfs2_journal_dirty(handle, bh); | 1003 | ocfs2_journal_dirty(handle, bh); |
1012 | if (status < 0) { | ||
1013 | mlog_errno(status); | ||
1014 | goto out_trans; | ||
1015 | } | ||
1016 | 1004 | ||
1017 | /* Initialize new block with structures */ | 1005 | /* Initialize new block with structures */ |
1018 | down_read(&OCFS2_I(lqinode)->ip_alloc_sem); | 1006 | down_read(&OCFS2_I(lqinode)->ip_alloc_sem); |
@@ -1039,11 +1027,7 @@ static struct ocfs2_quota_chunk *ocfs2_local_quota_add_chunk( | |||
1039 | lock_buffer(dbh); | 1027 | lock_buffer(dbh); |
1040 | memset(dbh->b_data, 0, sb->s_blocksize - OCFS2_QBLK_RESERVED_SPACE); | 1028 | memset(dbh->b_data, 0, sb->s_blocksize - OCFS2_QBLK_RESERVED_SPACE); |
1041 | unlock_buffer(dbh); | 1029 | unlock_buffer(dbh); |
1042 | status = ocfs2_journal_dirty(handle, dbh); | 1030 | ocfs2_journal_dirty(handle, dbh); |
1043 | if (status < 0) { | ||
1044 | mlog_errno(status); | ||
1045 | goto out_trans; | ||
1046 | } | ||
1047 | 1031 | ||
1048 | /* Update local quotafile info */ | 1032 | /* Update local quotafile info */ |
1049 | oinfo->dqi_blocks += 2; | 1033 | oinfo->dqi_blocks += 2; |
@@ -1154,11 +1138,8 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file( | |||
1154 | lock_buffer(bh); | 1138 | lock_buffer(bh); |
1155 | memset(bh->b_data, 0, sb->s_blocksize); | 1139 | memset(bh->b_data, 0, sb->s_blocksize); |
1156 | unlock_buffer(bh); | 1140 | unlock_buffer(bh); |
1157 | status = ocfs2_journal_dirty(handle, bh); | 1141 | ocfs2_journal_dirty(handle, bh); |
1158 | if (status < 0) { | 1142 | |
1159 | mlog_errno(status); | ||
1160 | goto out_trans; | ||
1161 | } | ||
1162 | /* Update chunk header */ | 1143 | /* Update chunk header */ |
1163 | status = ocfs2_journal_access_dq(handle, INODE_CACHE(lqinode), | 1144 | status = ocfs2_journal_access_dq(handle, INODE_CACHE(lqinode), |
1164 | chunk->qc_headerbh, | 1145 | chunk->qc_headerbh, |
@@ -1172,11 +1153,8 @@ static struct ocfs2_quota_chunk *ocfs2_extend_local_quota_file( | |||
1172 | lock_buffer(chunk->qc_headerbh); | 1153 | lock_buffer(chunk->qc_headerbh); |
1173 | le32_add_cpu(&dchunk->dqc_free, ol_quota_entries_per_block(sb)); | 1154 | le32_add_cpu(&dchunk->dqc_free, ol_quota_entries_per_block(sb)); |
1174 | unlock_buffer(chunk->qc_headerbh); | 1155 | unlock_buffer(chunk->qc_headerbh); |
1175 | status = ocfs2_journal_dirty(handle, chunk->qc_headerbh); | 1156 | ocfs2_journal_dirty(handle, chunk->qc_headerbh); |
1176 | if (status < 0) { | 1157 | |
1177 | mlog_errno(status); | ||
1178 | goto out_trans; | ||
1179 | } | ||
1180 | /* Update file header */ | 1158 | /* Update file header */ |
1181 | oinfo->dqi_blocks++; | 1159 | oinfo->dqi_blocks++; |
1182 | status = ocfs2_local_write_info(sb, type); | 1160 | status = ocfs2_local_write_info(sb, type); |
@@ -1311,12 +1289,8 @@ static int ocfs2_local_release_dquot(struct dquot *dquot) | |||
1311 | ocfs2_clear_bit(offset, dchunk->dqc_bitmap); | 1289 | ocfs2_clear_bit(offset, dchunk->dqc_bitmap); |
1312 | le32_add_cpu(&dchunk->dqc_free, 1); | 1290 | le32_add_cpu(&dchunk->dqc_free, 1); |
1313 | unlock_buffer(od->dq_chunk->qc_headerbh); | 1291 | unlock_buffer(od->dq_chunk->qc_headerbh); |
1314 | status = ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh); | 1292 | ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh); |
1315 | if (status < 0) { | 1293 | |
1316 | mlog_errno(status); | ||
1317 | goto out; | ||
1318 | } | ||
1319 | status = 0; | ||
1320 | out: | 1294 | out: |
1321 | /* Clear the read bit so that next time someone uses this | 1295 | /* Clear the read bit so that next time someone uses this |
1322 | * dquot he reads fresh info from disk and allocates local | 1296 | * dquot he reads fresh info from disk and allocates local |
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 29405f2ff616..4b0b4eb79352 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -1269,9 +1269,7 @@ static int ocfs2_change_refcount_rec(handle_t *handle, | |||
1269 | } else if (merge) | 1269 | } else if (merge) |
1270 | ocfs2_refcount_rec_merge(rb, index); | 1270 | ocfs2_refcount_rec_merge(rb, index); |
1271 | 1271 | ||
1272 | ret = ocfs2_journal_dirty(handle, ref_leaf_bh); | 1272 | ocfs2_journal_dirty(handle, ref_leaf_bh); |
1273 | if (ret) | ||
1274 | mlog_errno(ret); | ||
1275 | out: | 1273 | out: |
1276 | return ret; | 1274 | return ret; |
1277 | } | 1275 | } |
@@ -1803,11 +1801,7 @@ static int ocfs2_insert_refcount_rec(handle_t *handle, | |||
1803 | if (merge) | 1801 | if (merge) |
1804 | ocfs2_refcount_rec_merge(rb, index); | 1802 | ocfs2_refcount_rec_merge(rb, index); |
1805 | 1803 | ||
1806 | ret = ocfs2_journal_dirty(handle, ref_leaf_bh); | 1804 | ocfs2_journal_dirty(handle, ref_leaf_bh); |
1807 | if (ret) { | ||
1808 | mlog_errno(ret); | ||
1809 | goto out; | ||
1810 | } | ||
1811 | 1805 | ||
1812 | if (index == 0) { | 1806 | if (index == 0) { |
1813 | ret = ocfs2_adjust_refcount_rec(handle, ci, | 1807 | ret = ocfs2_adjust_refcount_rec(handle, ci, |
@@ -1978,9 +1972,7 @@ static int ocfs2_split_refcount_rec(handle_t *handle, | |||
1978 | ocfs2_refcount_rec_merge(rb, index); | 1972 | ocfs2_refcount_rec_merge(rb, index); |
1979 | } | 1973 | } |
1980 | 1974 | ||
1981 | ret = ocfs2_journal_dirty(handle, ref_leaf_bh); | 1975 | ocfs2_journal_dirty(handle, ref_leaf_bh); |
1982 | if (ret) | ||
1983 | mlog_errno(ret); | ||
1984 | 1976 | ||
1985 | out: | 1977 | out: |
1986 | brelse(new_bh); | 1978 | brelse(new_bh); |
@@ -3041,11 +3033,7 @@ static int ocfs2_duplicate_clusters_by_jbd(handle_t *handle, | |||
3041 | } | 3033 | } |
3042 | 3034 | ||
3043 | memcpy(new_bh->b_data, old_bh->b_data, sb->s_blocksize); | 3035 | memcpy(new_bh->b_data, old_bh->b_data, sb->s_blocksize); |
3044 | ret = ocfs2_journal_dirty(handle, new_bh); | 3036 | ocfs2_journal_dirty(handle, new_bh); |
3045 | if (ret) { | ||
3046 | mlog_errno(ret); | ||
3047 | break; | ||
3048 | } | ||
3049 | 3037 | ||
3050 | brelse(new_bh); | 3038 | brelse(new_bh); |
3051 | brelse(old_bh); | 3039 | brelse(old_bh); |
diff --git a/fs/ocfs2/resize.c b/fs/ocfs2/resize.c index 3c3d673a4d20..a821f667b5c4 100644 --- a/fs/ocfs2/resize.c +++ b/fs/ocfs2/resize.c | |||
@@ -134,11 +134,7 @@ static int ocfs2_update_last_group_and_inode(handle_t *handle, | |||
134 | le16_add_cpu(&group->bg_free_bits_count, -1 * backups); | 134 | le16_add_cpu(&group->bg_free_bits_count, -1 * backups); |
135 | } | 135 | } |
136 | 136 | ||
137 | ret = ocfs2_journal_dirty(handle, group_bh); | 137 | ocfs2_journal_dirty(handle, group_bh); |
138 | if (ret < 0) { | ||
139 | mlog_errno(ret); | ||
140 | goto out_rollback; | ||
141 | } | ||
142 | 138 | ||
143 | /* update the inode accordingly. */ | 139 | /* update the inode accordingly. */ |
144 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(bm_inode), bm_bh, | 140 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(bm_inode), bm_bh, |
@@ -545,12 +541,7 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input) | |||
545 | 541 | ||
546 | group = (struct ocfs2_group_desc *)group_bh->b_data; | 542 | group = (struct ocfs2_group_desc *)group_bh->b_data; |
547 | group->bg_next_group = cr->c_blkno; | 543 | group->bg_next_group = cr->c_blkno; |
548 | 544 | ocfs2_journal_dirty(handle, group_bh); | |
549 | ret = ocfs2_journal_dirty(handle, group_bh); | ||
550 | if (ret < 0) { | ||
551 | mlog_errno(ret); | ||
552 | goto out_commit; | ||
553 | } | ||
554 | 545 | ||
555 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(main_bm_inode), | 546 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(main_bm_inode), |
556 | main_bm_bh, OCFS2_JOURNAL_ACCESS_WRITE); | 547 | main_bm_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 19ba00f28547..d4babfba4f04 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -369,9 +369,7 @@ static int ocfs2_block_group_fill(handle_t *handle, | |||
369 | ocfs2_set_bit(0, (unsigned long *)bg->bg_bitmap); | 369 | ocfs2_set_bit(0, (unsigned long *)bg->bg_bitmap); |
370 | bg->bg_free_bits_count = cpu_to_le16(le16_to_cpu(bg->bg_bits) - 1); | 370 | bg->bg_free_bits_count = cpu_to_le16(le16_to_cpu(bg->bg_bits) - 1); |
371 | 371 | ||
372 | status = ocfs2_journal_dirty(handle, bg_bh); | 372 | ocfs2_journal_dirty(handle, bg_bh); |
373 | if (status < 0) | ||
374 | mlog_errno(status); | ||
375 | 373 | ||
376 | /* There is no need to zero out or otherwise initialize the | 374 | /* There is no need to zero out or otherwise initialize the |
377 | * other blocks in a group - All valid FS metadata in a block | 375 | * other blocks in a group - All valid FS metadata in a block |
@@ -506,11 +504,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, | |||
506 | le32_add_cpu(&fe->id1.bitmap1.i_total, le16_to_cpu(bg->bg_bits)); | 504 | le32_add_cpu(&fe->id1.bitmap1.i_total, le16_to_cpu(bg->bg_bits)); |
507 | le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); | 505 | le32_add_cpu(&fe->i_clusters, le16_to_cpu(cl->cl_cpg)); |
508 | 506 | ||
509 | status = ocfs2_journal_dirty(handle, bh); | 507 | ocfs2_journal_dirty(handle, bh); |
510 | if (status < 0) { | ||
511 | mlog_errno(status); | ||
512 | goto bail; | ||
513 | } | ||
514 | 508 | ||
515 | spin_lock(&OCFS2_I(alloc_inode)->ip_lock); | 509 | spin_lock(&OCFS2_I(alloc_inode)->ip_lock); |
516 | OCFS2_I(alloc_inode)->ip_clusters = le32_to_cpu(fe->i_clusters); | 510 | OCFS2_I(alloc_inode)->ip_clusters = le32_to_cpu(fe->i_clusters); |
@@ -1129,16 +1123,10 @@ static inline int ocfs2_block_group_set_bits(handle_t *handle, | |||
1129 | } | 1123 | } |
1130 | 1124 | ||
1131 | le16_add_cpu(&bg->bg_free_bits_count, -num_bits); | 1125 | le16_add_cpu(&bg->bg_free_bits_count, -num_bits); |
1132 | |||
1133 | while(num_bits--) | 1126 | while(num_bits--) |
1134 | ocfs2_set_bit(bit_off++, bitmap); | 1127 | ocfs2_set_bit(bit_off++, bitmap); |
1135 | 1128 | ||
1136 | status = ocfs2_journal_dirty(handle, | 1129 | ocfs2_journal_dirty(handle, group_bh); |
1137 | group_bh); | ||
1138 | if (status < 0) { | ||
1139 | mlog_errno(status); | ||
1140 | goto bail; | ||
1141 | } | ||
1142 | 1130 | ||
1143 | bail: | 1131 | bail: |
1144 | mlog_exit(status); | 1132 | mlog_exit(status); |
@@ -1202,12 +1190,7 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
1202 | } | 1190 | } |
1203 | 1191 | ||
1204 | prev_bg->bg_next_group = bg->bg_next_group; | 1192 | prev_bg->bg_next_group = bg->bg_next_group; |
1205 | 1193 | ocfs2_journal_dirty(handle, prev_bg_bh); | |
1206 | status = ocfs2_journal_dirty(handle, prev_bg_bh); | ||
1207 | if (status < 0) { | ||
1208 | mlog_errno(status); | ||
1209 | goto out_rollback; | ||
1210 | } | ||
1211 | 1194 | ||
1212 | status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), | 1195 | status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), |
1213 | bg_bh, OCFS2_JOURNAL_ACCESS_WRITE); | 1196 | bg_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
@@ -1217,12 +1200,7 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
1217 | } | 1200 | } |
1218 | 1201 | ||
1219 | bg->bg_next_group = fe->id2.i_chain.cl_recs[chain].c_blkno; | 1202 | bg->bg_next_group = fe->id2.i_chain.cl_recs[chain].c_blkno; |
1220 | 1203 | ocfs2_journal_dirty(handle, bg_bh); | |
1221 | status = ocfs2_journal_dirty(handle, bg_bh); | ||
1222 | if (status < 0) { | ||
1223 | mlog_errno(status); | ||
1224 | goto out_rollback; | ||
1225 | } | ||
1226 | 1204 | ||
1227 | status = ocfs2_journal_access_di(handle, INODE_CACHE(alloc_inode), | 1205 | status = ocfs2_journal_access_di(handle, INODE_CACHE(alloc_inode), |
1228 | fe_bh, OCFS2_JOURNAL_ACCESS_WRITE); | 1206 | fe_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
@@ -1232,14 +1210,8 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
1232 | } | 1210 | } |
1233 | 1211 | ||
1234 | fe->id2.i_chain.cl_recs[chain].c_blkno = bg->bg_blkno; | 1212 | fe->id2.i_chain.cl_recs[chain].c_blkno = bg->bg_blkno; |
1213 | ocfs2_journal_dirty(handle, fe_bh); | ||
1235 | 1214 | ||
1236 | status = ocfs2_journal_dirty(handle, fe_bh); | ||
1237 | if (status < 0) { | ||
1238 | mlog_errno(status); | ||
1239 | goto out_rollback; | ||
1240 | } | ||
1241 | |||
1242 | status = 0; | ||
1243 | out_rollback: | 1215 | out_rollback: |
1244 | if (status < 0) { | 1216 | if (status < 0) { |
1245 | fe->id2.i_chain.cl_recs[chain].c_blkno = cpu_to_le64(fe_ptr); | 1217 | fe->id2.i_chain.cl_recs[chain].c_blkno = cpu_to_le64(fe_ptr); |
@@ -1386,10 +1358,7 @@ static int ocfs2_alloc_dinode_update_counts(struct inode *inode, | |||
1386 | tmp_used = le32_to_cpu(di->id1.bitmap1.i_used); | 1358 | tmp_used = le32_to_cpu(di->id1.bitmap1.i_used); |
1387 | di->id1.bitmap1.i_used = cpu_to_le32(num_bits + tmp_used); | 1359 | di->id1.bitmap1.i_used = cpu_to_le32(num_bits + tmp_used); |
1388 | le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); | 1360 | le32_add_cpu(&cl->cl_recs[chain].c_free, -num_bits); |
1389 | 1361 | ocfs2_journal_dirty(handle, di_bh); | |
1390 | ret = ocfs2_journal_dirty(handle, di_bh); | ||
1391 | if (ret < 0) | ||
1392 | mlog_errno(ret); | ||
1393 | 1362 | ||
1394 | out: | 1363 | out: |
1395 | return ret; | 1364 | return ret; |
@@ -1560,13 +1529,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
1560 | tmp_used = le32_to_cpu(fe->id1.bitmap1.i_used); | 1529 | tmp_used = le32_to_cpu(fe->id1.bitmap1.i_used); |
1561 | fe->id1.bitmap1.i_used = cpu_to_le32(*num_bits + tmp_used); | 1530 | fe->id1.bitmap1.i_used = cpu_to_le32(*num_bits + tmp_used); |
1562 | le32_add_cpu(&cl->cl_recs[chain].c_free, -(*num_bits)); | 1531 | le32_add_cpu(&cl->cl_recs[chain].c_free, -(*num_bits)); |
1563 | 1532 | ocfs2_journal_dirty(handle, ac->ac_bh); | |
1564 | status = ocfs2_journal_dirty(handle, | ||
1565 | ac->ac_bh); | ||
1566 | if (status < 0) { | ||
1567 | mlog_errno(status); | ||
1568 | goto bail; | ||
1569 | } | ||
1570 | 1533 | ||
1571 | status = ocfs2_block_group_set_bits(handle, | 1534 | status = ocfs2_block_group_set_bits(handle, |
1572 | alloc_inode, | 1535 | alloc_inode, |
@@ -2023,9 +1986,7 @@ static int ocfs2_block_group_clear_bits(handle_t *handle, | |||
2023 | if (undo_fn) | 1986 | if (undo_fn) |
2024 | jbd_unlock_bh_state(group_bh); | 1987 | jbd_unlock_bh_state(group_bh); |
2025 | 1988 | ||
2026 | status = ocfs2_journal_dirty(handle, group_bh); | 1989 | ocfs2_journal_dirty(handle, group_bh); |
2027 | if (status < 0) | ||
2028 | mlog_errno(status); | ||
2029 | bail: | 1990 | bail: |
2030 | return status; | 1991 | return status; |
2031 | } | 1992 | } |
@@ -2092,12 +2053,7 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle, | |||
2092 | count); | 2053 | count); |
2093 | tmp_used = le32_to_cpu(fe->id1.bitmap1.i_used); | 2054 | tmp_used = le32_to_cpu(fe->id1.bitmap1.i_used); |
2094 | fe->id1.bitmap1.i_used = cpu_to_le32(tmp_used - count); | 2055 | fe->id1.bitmap1.i_used = cpu_to_le32(tmp_used - count); |
2095 | 2056 | ocfs2_journal_dirty(handle, alloc_bh); | |
2096 | status = ocfs2_journal_dirty(handle, alloc_bh); | ||
2097 | if (status < 0) { | ||
2098 | mlog_errno(status); | ||
2099 | goto bail; | ||
2100 | } | ||
2101 | 2057 | ||
2102 | bail: | 2058 | bail: |
2103 | brelse(group_bh); | 2059 | brelse(group_bh); |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 3e7773089b96..4cf6fde71027 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -739,11 +739,7 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
739 | goto leave; | 739 | goto leave; |
740 | } | 740 | } |
741 | 741 | ||
742 | status = ocfs2_journal_dirty(handle, vb->vb_bh); | 742 | ocfs2_journal_dirty(handle, vb->vb_bh); |
743 | if (status < 0) { | ||
744 | mlog_errno(status); | ||
745 | goto leave; | ||
746 | } | ||
747 | 743 | ||
748 | clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; | 744 | clusters_to_add -= le32_to_cpu(vb->vb_xv->xr_clusters) - prev_clusters; |
749 | 745 | ||
@@ -786,12 +782,7 @@ static int __ocfs2_remove_xattr_range(struct inode *inode, | |||
786 | } | 782 | } |
787 | 783 | ||
788 | le32_add_cpu(&vb->vb_xv->xr_clusters, -len); | 784 | le32_add_cpu(&vb->vb_xv->xr_clusters, -len); |
789 | 785 | ocfs2_journal_dirty(handle, vb->vb_bh); | |
790 | ret = ocfs2_journal_dirty(handle, vb->vb_bh); | ||
791 | if (ret) { | ||
792 | mlog_errno(ret); | ||
793 | goto out; | ||
794 | } | ||
795 | 786 | ||
796 | if (ext_flags & OCFS2_EXT_REFCOUNTED) | 787 | if (ext_flags & OCFS2_EXT_REFCOUNTED) |
797 | ret = ocfs2_decrease_refcount(inode, handle, | 788 | ret = ocfs2_decrease_refcount(inode, handle, |
@@ -1374,11 +1365,7 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode, | |||
1374 | memset(bh->b_data + cp_len, 0, | 1365 | memset(bh->b_data + cp_len, 0, |
1375 | blocksize - cp_len); | 1366 | blocksize - cp_len); |
1376 | 1367 | ||
1377 | ret = ocfs2_journal_dirty(handle, bh); | 1368 | ocfs2_journal_dirty(handle, bh); |
1378 | if (ret < 0) { | ||
1379 | mlog_errno(ret); | ||
1380 | goto out; | ||
1381 | } | ||
1382 | brelse(bh); | 1369 | brelse(bh); |
1383 | bh = NULL; | 1370 | bh = NULL; |
1384 | 1371 | ||
@@ -2594,9 +2581,7 @@ int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh) | |||
2594 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 2581 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
2595 | spin_unlock(&oi->ip_lock); | 2582 | spin_unlock(&oi->ip_lock); |
2596 | 2583 | ||
2597 | ret = ocfs2_journal_dirty(handle, di_bh); | 2584 | ocfs2_journal_dirty(handle, di_bh); |
2598 | if (ret < 0) | ||
2599 | mlog_errno(ret); | ||
2600 | out_commit: | 2585 | out_commit: |
2601 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); | 2586 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); |
2602 | out: | 2587 | out: |
@@ -2724,9 +2709,7 @@ static int ocfs2_xattr_ibody_init(struct inode *inode, | |||
2724 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); | 2709 | di->i_dyn_features = cpu_to_le16(oi->ip_dyn_features); |
2725 | spin_unlock(&oi->ip_lock); | 2710 | spin_unlock(&oi->ip_lock); |
2726 | 2711 | ||
2727 | ret = ocfs2_journal_dirty(ctxt->handle, di_bh); | 2712 | ocfs2_journal_dirty(ctxt->handle, di_bh); |
2728 | if (ret < 0) | ||
2729 | mlog_errno(ret); | ||
2730 | 2713 | ||
2731 | out: | 2714 | out: |
2732 | return ret; | 2715 | return ret; |
@@ -5153,9 +5136,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5153 | goto leave; | 5136 | goto leave; |
5154 | } | 5137 | } |
5155 | 5138 | ||
5156 | ret = ocfs2_journal_dirty(handle, root_bh); | 5139 | ocfs2_journal_dirty(handle, root_bh); |
5157 | if (ret < 0) | ||
5158 | mlog_errno(ret); | ||
5159 | 5140 | ||
5160 | leave: | 5141 | leave: |
5161 | return ret; | 5142 | return ret; |
@@ -5477,12 +5458,7 @@ static int ocfs2_rm_xattr_cluster(struct inode *inode, | |||
5477 | } | 5458 | } |
5478 | 5459 | ||
5479 | le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, -len); | 5460 | le32_add_cpu(&xb->xb_attrs.xb_root.xt_clusters, -len); |
5480 | 5461 | ocfs2_journal_dirty(handle, root_bh); | |
5481 | ret = ocfs2_journal_dirty(handle, root_bh); | ||
5482 | if (ret) { | ||
5483 | mlog_errno(ret); | ||
5484 | goto out_commit; | ||
5485 | } | ||
5486 | 5462 | ||
5487 | ret = ocfs2_truncate_log_append(osb, handle, blkno, len); | 5463 | ret = ocfs2_truncate_log_append(osb, handle, blkno, len); |
5488 | if (ret) | 5464 | if (ret) |