diff options
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r-- | fs/ocfs2/dir.c | 48 |
1 files changed, 9 insertions, 39 deletions
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); |