diff options
author | Joel Becker <joel.becker@oracle.com> | 2009-02-12 19:41:25 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-04 19:07:50 -0400 |
commit | 0cf2f7632b1789b811ab20b611c4156e6de2b055 (patch) | |
tree | 34f7cf3584e4fa2bc187d4b75ce052cb98739b0e /fs/ocfs2/suballoc.c | |
parent | 292dd27ec76b96cebcef576f330ab121f59ccf05 (diff) |
ocfs2: Pass struct ocfs2_caching_info to the journal functions.
The next step in divorcing metadata I/O management from struct inode is
to pass struct ocfs2_caching_info to the journal functions. Thus the
journal locks a metadata cache with the cache io_lock function. It also
can compare ci_last_trans and ci_created_trans directly.
This is a large patch because of all the places we change
ocfs2_journal_access..(handle, inode, ...) to
ocfs2_journal_access..(handle, INODE_CACHE(inode), ...).
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r-- | fs/ocfs2/suballoc.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 21aaaaaaa2d3..a6c442c82e3d 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -352,7 +352,7 @@ static int ocfs2_block_group_fill(handle_t *handle, | |||
352 | } | 352 | } |
353 | 353 | ||
354 | status = ocfs2_journal_access_gd(handle, | 354 | status = ocfs2_journal_access_gd(handle, |
355 | alloc_inode, | 355 | INODE_CACHE(alloc_inode), |
356 | bg_bh, | 356 | bg_bh, |
357 | OCFS2_JOURNAL_ACCESS_CREATE); | 357 | OCFS2_JOURNAL_ACCESS_CREATE); |
358 | if (status < 0) { | 358 | if (status < 0) { |
@@ -491,7 +491,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb, | |||
491 | 491 | ||
492 | bg = (struct ocfs2_group_desc *) bg_bh->b_data; | 492 | bg = (struct ocfs2_group_desc *) bg_bh->b_data; |
493 | 493 | ||
494 | status = ocfs2_journal_access_di(handle, alloc_inode, | 494 | status = ocfs2_journal_access_di(handle, INODE_CACHE(alloc_inode), |
495 | bh, OCFS2_JOURNAL_ACCESS_WRITE); | 495 | bh, OCFS2_JOURNAL_ACCESS_WRITE); |
496 | if (status < 0) { | 496 | if (status < 0) { |
497 | mlog_errno(status); | 497 | mlog_errno(status); |
@@ -1033,7 +1033,7 @@ static inline int ocfs2_block_group_set_bits(handle_t *handle, | |||
1033 | journal_type = OCFS2_JOURNAL_ACCESS_UNDO; | 1033 | journal_type = OCFS2_JOURNAL_ACCESS_UNDO; |
1034 | 1034 | ||
1035 | status = ocfs2_journal_access_gd(handle, | 1035 | status = ocfs2_journal_access_gd(handle, |
1036 | alloc_inode, | 1036 | INODE_CACHE(alloc_inode), |
1037 | group_bh, | 1037 | group_bh, |
1038 | journal_type); | 1038 | journal_type); |
1039 | if (status < 0) { | 1039 | if (status < 0) { |
@@ -1106,7 +1106,8 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
1106 | bg_ptr = le64_to_cpu(bg->bg_next_group); | 1106 | bg_ptr = le64_to_cpu(bg->bg_next_group); |
1107 | prev_bg_ptr = le64_to_cpu(prev_bg->bg_next_group); | 1107 | prev_bg_ptr = le64_to_cpu(prev_bg->bg_next_group); |
1108 | 1108 | ||
1109 | status = ocfs2_journal_access_gd(handle, alloc_inode, prev_bg_bh, | 1109 | status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), |
1110 | prev_bg_bh, | ||
1110 | OCFS2_JOURNAL_ACCESS_WRITE); | 1111 | OCFS2_JOURNAL_ACCESS_WRITE); |
1111 | if (status < 0) { | 1112 | if (status < 0) { |
1112 | mlog_errno(status); | 1113 | mlog_errno(status); |
@@ -1121,8 +1122,8 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
1121 | goto out_rollback; | 1122 | goto out_rollback; |
1122 | } | 1123 | } |
1123 | 1124 | ||
1124 | status = ocfs2_journal_access_gd(handle, alloc_inode, bg_bh, | 1125 | status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), |
1125 | OCFS2_JOURNAL_ACCESS_WRITE); | 1126 | bg_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
1126 | if (status < 0) { | 1127 | if (status < 0) { |
1127 | mlog_errno(status); | 1128 | mlog_errno(status); |
1128 | goto out_rollback; | 1129 | goto out_rollback; |
@@ -1136,8 +1137,8 @@ static int ocfs2_relink_block_group(handle_t *handle, | |||
1136 | goto out_rollback; | 1137 | goto out_rollback; |
1137 | } | 1138 | } |
1138 | 1139 | ||
1139 | status = ocfs2_journal_access_di(handle, alloc_inode, fe_bh, | 1140 | status = ocfs2_journal_access_di(handle, INODE_CACHE(alloc_inode), |
1140 | OCFS2_JOURNAL_ACCESS_WRITE); | 1141 | fe_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
1141 | if (status < 0) { | 1142 | if (status < 0) { |
1142 | mlog_errno(status); | 1143 | mlog_errno(status); |
1143 | goto out_rollback; | 1144 | goto out_rollback; |
@@ -1288,7 +1289,7 @@ static int ocfs2_alloc_dinode_update_counts(struct inode *inode, | |||
1288 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data; | 1289 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data; |
1289 | struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; | 1290 | struct ocfs2_chain_list *cl = (struct ocfs2_chain_list *) &di->id2.i_chain; |
1290 | 1291 | ||
1291 | ret = ocfs2_journal_access_di(handle, inode, di_bh, | 1292 | ret = ocfs2_journal_access_di(handle, INODE_CACHE(inode), di_bh, |
1292 | OCFS2_JOURNAL_ACCESS_WRITE); | 1293 | OCFS2_JOURNAL_ACCESS_WRITE); |
1293 | if (ret < 0) { | 1294 | if (ret < 0) { |
1294 | mlog_errno(ret); | 1295 | mlog_errno(ret); |
@@ -1461,7 +1462,7 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac, | |||
1461 | /* Ok, claim our bits now: set the info on dinode, chainlist | 1462 | /* Ok, claim our bits now: set the info on dinode, chainlist |
1462 | * and then the group */ | 1463 | * and then the group */ |
1463 | status = ocfs2_journal_access_di(handle, | 1464 | status = ocfs2_journal_access_di(handle, |
1464 | alloc_inode, | 1465 | INODE_CACHE(alloc_inode), |
1465 | ac->ac_bh, | 1466 | ac->ac_bh, |
1466 | OCFS2_JOURNAL_ACCESS_WRITE); | 1467 | OCFS2_JOURNAL_ACCESS_WRITE); |
1467 | if (status < 0) { | 1468 | if (status < 0) { |
@@ -1907,8 +1908,8 @@ static inline int ocfs2_block_group_clear_bits(handle_t *handle, | |||
1907 | if (ocfs2_is_cluster_bitmap(alloc_inode)) | 1908 | if (ocfs2_is_cluster_bitmap(alloc_inode)) |
1908 | journal_type = OCFS2_JOURNAL_ACCESS_UNDO; | 1909 | journal_type = OCFS2_JOURNAL_ACCESS_UNDO; |
1909 | 1910 | ||
1910 | status = ocfs2_journal_access_gd(handle, alloc_inode, group_bh, | 1911 | status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), |
1911 | journal_type); | 1912 | group_bh, journal_type); |
1912 | if (status < 0) { | 1913 | if (status < 0) { |
1913 | mlog_errno(status); | 1914 | mlog_errno(status); |
1914 | goto bail; | 1915 | goto bail; |
@@ -1993,8 +1994,8 @@ int ocfs2_free_suballoc_bits(handle_t *handle, | |||
1993 | goto bail; | 1994 | goto bail; |
1994 | } | 1995 | } |
1995 | 1996 | ||
1996 | status = ocfs2_journal_access_di(handle, alloc_inode, alloc_bh, | 1997 | status = ocfs2_journal_access_di(handle, INODE_CACHE(alloc_inode), |
1997 | OCFS2_JOURNAL_ACCESS_WRITE); | 1998 | alloc_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
1998 | if (status < 0) { | 1999 | if (status < 0) { |
1999 | mlog_errno(status); | 2000 | mlog_errno(status); |
2000 | goto bail; | 2001 | goto bail; |