diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-10-09 20:20:30 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-14 14:43:29 -0400 |
commit | 31d33073ca38603dea705dae45e094a64ca062d6 (patch) | |
tree | cf02beb489456ebc9e07bace80e96ad1150f2cbf /fs/ocfs2/xattr.c | |
parent | da1e90985a0e767e44397c9db0937e236033fa58 (diff) |
ocfs2: Require an inode for ocfs2_read_block(s)().
Now that synchronous readers are using ocfs2_read_blocks_sync(), all
callers of ocfs2_read_blocks() are passing an inode. Use it
unconditionally. Since it's there, we don't need to pass the
ocfs2_super either.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 74 |
1 files changed, 35 insertions, 39 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 8f522f2f84a5..63037bd7892f 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -537,9 +537,9 @@ static int ocfs2_xattr_block_list(struct inode *inode, | |||
537 | if (!di->i_xattr_loc) | 537 | if (!di->i_xattr_loc) |
538 | return ret; | 538 | return ret; |
539 | 539 | ||
540 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), | 540 | ret = ocfs2_read_block(inode, |
541 | le64_to_cpu(di->i_xattr_loc), | 541 | le64_to_cpu(di->i_xattr_loc), |
542 | &blk_bh, OCFS2_BH_CACHED, inode); | 542 | &blk_bh, OCFS2_BH_CACHED); |
543 | if (ret < 0) { | 543 | if (ret < 0) { |
544 | mlog_errno(ret); | 544 | mlog_errno(ret); |
545 | return ret; | 545 | return ret; |
@@ -672,8 +672,8 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode, | |||
672 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); | 672 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); |
673 | /* Copy ocfs2_xattr_value */ | 673 | /* Copy ocfs2_xattr_value */ |
674 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { | 674 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { |
675 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, | 675 | ret = ocfs2_read_block(inode, blkno, |
676 | &bh, OCFS2_BH_CACHED, inode); | 676 | &bh, OCFS2_BH_CACHED); |
677 | if (ret) { | 677 | if (ret) { |
678 | mlog_errno(ret); | 678 | mlog_errno(ret); |
679 | goto out; | 679 | goto out; |
@@ -764,9 +764,9 @@ static int ocfs2_xattr_block_get(struct inode *inode, | |||
764 | 764 | ||
765 | memset(&xs->bucket, 0, sizeof(xs->bucket)); | 765 | memset(&xs->bucket, 0, sizeof(xs->bucket)); |
766 | 766 | ||
767 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), | 767 | ret = ocfs2_read_block(inode, |
768 | le64_to_cpu(di->i_xattr_loc), | 768 | le64_to_cpu(di->i_xattr_loc), |
769 | &blk_bh, OCFS2_BH_CACHED, inode); | 769 | &blk_bh, OCFS2_BH_CACHED); |
770 | if (ret < 0) { | 770 | if (ret < 0) { |
771 | mlog_errno(ret); | 771 | mlog_errno(ret); |
772 | return ret; | 772 | return ret; |
@@ -922,8 +922,8 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode, | |||
922 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); | 922 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); |
923 | 923 | ||
924 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { | 924 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { |
925 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, | 925 | ret = ocfs2_read_block(inode, blkno, |
926 | &bh, OCFS2_BH_CACHED, inode); | 926 | &bh, OCFS2_BH_CACHED); |
927 | if (ret) { | 927 | if (ret) { |
928 | mlog_errno(ret); | 928 | mlog_errno(ret); |
929 | goto out_commit; | 929 | goto out_commit; |
@@ -1514,8 +1514,8 @@ static int ocfs2_xattr_free_block(struct inode *inode, | |||
1514 | u64 blk, bg_blkno; | 1514 | u64 blk, bg_blkno; |
1515 | u16 bit; | 1515 | u16 bit; |
1516 | 1516 | ||
1517 | ret = ocfs2_read_block(osb, block, &blk_bh, | 1517 | ret = ocfs2_read_block(inode, block, &blk_bh, |
1518 | OCFS2_BH_CACHED, inode); | 1518 | OCFS2_BH_CACHED); |
1519 | if (ret < 0) { | 1519 | if (ret < 0) { |
1520 | mlog_errno(ret); | 1520 | mlog_errno(ret); |
1521 | goto out; | 1521 | goto out; |
@@ -1773,9 +1773,9 @@ static int ocfs2_xattr_block_find(struct inode *inode, | |||
1773 | if (!di->i_xattr_loc) | 1773 | if (!di->i_xattr_loc) |
1774 | return ret; | 1774 | return ret; |
1775 | 1775 | ||
1776 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), | 1776 | ret = ocfs2_read_block(inode, |
1777 | le64_to_cpu(di->i_xattr_loc), | 1777 | le64_to_cpu(di->i_xattr_loc), |
1778 | &blk_bh, OCFS2_BH_CACHED, inode); | 1778 | &blk_bh, OCFS2_BH_CACHED); |
1779 | if (ret < 0) { | 1779 | if (ret < 0) { |
1780 | mlog_errno(ret); | 1780 | mlog_errno(ret); |
1781 | return ret; | 1781 | return ret; |
@@ -2216,9 +2216,9 @@ static int ocfs2_find_xe_in_bucket(struct inode *inode, | |||
2216 | break; | 2216 | break; |
2217 | } | 2217 | } |
2218 | 2218 | ||
2219 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), | 2219 | ret = ocfs2_read_block(inode, |
2220 | header_bh->b_blocknr + block_off, | 2220 | header_bh->b_blocknr + block_off, |
2221 | &name_bh, OCFS2_BH_CACHED, inode); | 2221 | &name_bh, OCFS2_BH_CACHED); |
2222 | if (ret) { | 2222 | if (ret) { |
2223 | mlog_errno(ret); | 2223 | mlog_errno(ret); |
2224 | break; | 2224 | break; |
@@ -2269,8 +2269,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode, | |||
2269 | u32 last_hash; | 2269 | u32 last_hash; |
2270 | u64 blkno; | 2270 | u64 blkno; |
2271 | 2271 | ||
2272 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), p_blkno, | 2272 | ret = ocfs2_read_block(inode, p_blkno, &bh, OCFS2_BH_CACHED); |
2273 | &bh, OCFS2_BH_CACHED, inode); | ||
2274 | if (ret) { | 2273 | if (ret) { |
2275 | mlog_errno(ret); | 2274 | mlog_errno(ret); |
2276 | goto out; | 2275 | goto out; |
@@ -2286,8 +2285,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode, | |||
2286 | 2285 | ||
2287 | blkno = p_blkno + bucket * blk_per_bucket; | 2286 | blkno = p_blkno + bucket * blk_per_bucket; |
2288 | 2287 | ||
2289 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), blkno, | 2288 | ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED); |
2290 | &bh, OCFS2_BH_CACHED, inode); | ||
2291 | if (ret) { | 2289 | if (ret) { |
2292 | mlog_errno(ret); | 2290 | mlog_errno(ret); |
2293 | goto out; | 2291 | goto out; |
@@ -2359,10 +2357,9 @@ static int ocfs2_xattr_bucket_find(struct inode *inode, | |||
2359 | * If we have found the xattr enty, read all the blocks in | 2357 | * If we have found the xattr enty, read all the blocks in |
2360 | * this bucket. | 2358 | * this bucket. |
2361 | */ | 2359 | */ |
2362 | ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), | 2360 | ret = ocfs2_read_blocks(inode, xs->bucket.bhs[0]->b_blocknr + 1, |
2363 | xs->bucket.bhs[0]->b_blocknr + 1, | ||
2364 | blk_per_bucket - 1, &xs->bucket.bhs[1], | 2361 | blk_per_bucket - 1, &xs->bucket.bhs[1], |
2365 | OCFS2_BH_CACHED, inode); | 2362 | OCFS2_BH_CACHED); |
2366 | if (ret) { | 2363 | if (ret) { |
2367 | mlog_errno(ret); | 2364 | mlog_errno(ret); |
2368 | goto out; | 2365 | goto out; |
@@ -2438,9 +2435,8 @@ static int ocfs2_iterate_xattr_buckets(struct inode *inode, | |||
2438 | clusters, blkno); | 2435 | clusters, blkno); |
2439 | 2436 | ||
2440 | for (i = 0; i < num_buckets; i++, blkno += blk_per_bucket) { | 2437 | for (i = 0; i < num_buckets; i++, blkno += blk_per_bucket) { |
2441 | ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), | 2438 | ret = ocfs2_read_blocks(inode, blkno, blk_per_bucket, |
2442 | blkno, blk_per_bucket, | 2439 | bucket.bhs, OCFS2_BH_CACHED); |
2443 | bucket.bhs, OCFS2_BH_CACHED, inode); | ||
2444 | if (ret) { | 2440 | if (ret) { |
2445 | mlog_errno(ret); | 2441 | mlog_errno(ret); |
2446 | goto out; | 2442 | goto out; |
@@ -2705,10 +2701,10 @@ static int ocfs2_xattr_update_xattr_search(struct inode *inode, | |||
2705 | 2701 | ||
2706 | if (!xs->not_found) { | 2702 | if (!xs->not_found) { |
2707 | if (OCFS2_XATTR_BUCKET_SIZE != blocksize) { | 2703 | if (OCFS2_XATTR_BUCKET_SIZE != blocksize) { |
2708 | ret = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), | 2704 | ret = ocfs2_read_blocks(inode, |
2709 | xs->bucket.bhs[0]->b_blocknr + 1, | 2705 | xs->bucket.bhs[0]->b_blocknr + 1, |
2710 | blk_per_bucket - 1, &xs->bucket.bhs[1], | 2706 | blk_per_bucket - 1, &xs->bucket.bhs[1], |
2711 | OCFS2_BH_CACHED, inode); | 2707 | OCFS2_BH_CACHED); |
2712 | if (ret) { | 2708 | if (ret) { |
2713 | mlog_errno(ret); | 2709 | mlog_errno(ret); |
2714 | return ret; | 2710 | return ret; |
@@ -2913,8 +2909,8 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode, | |||
2913 | if (!bhs) | 2909 | if (!bhs) |
2914 | return -ENOMEM; | 2910 | return -ENOMEM; |
2915 | 2911 | ||
2916 | ret = ocfs2_read_blocks(osb, blkno, blk_per_bucket, bhs, | 2912 | ret = ocfs2_read_blocks(inode, blkno, blk_per_bucket, bhs, |
2917 | OCFS2_BH_CACHED, inode); | 2913 | OCFS2_BH_CACHED); |
2918 | if (ret) | 2914 | if (ret) |
2919 | goto out; | 2915 | goto out; |
2920 | 2916 | ||
@@ -3114,8 +3110,8 @@ static int ocfs2_mv_xattr_bucket_cross_cluster(struct inode *inode, | |||
3114 | goto out; | 3110 | goto out; |
3115 | } | 3111 | } |
3116 | 3112 | ||
3117 | ret = ocfs2_read_block(osb, prev_blkno, | 3113 | ret = ocfs2_read_block(inode, prev_blkno, |
3118 | &old_bh, OCFS2_BH_CACHED, inode); | 3114 | &old_bh, OCFS2_BH_CACHED); |
3119 | if (ret < 0) { | 3115 | if (ret < 0) { |
3120 | mlog_errno(ret); | 3116 | mlog_errno(ret); |
3121 | brelse(new_bh); | 3117 | brelse(new_bh); |
@@ -3168,9 +3164,9 @@ static int ocfs2_read_xattr_bucket(struct inode *inode, | |||
3168 | u16 i, blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); | 3164 | u16 i, blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); |
3169 | 3165 | ||
3170 | if (!new) | 3166 | if (!new) |
3171 | return ocfs2_read_blocks(OCFS2_SB(inode->i_sb), blkno, | 3167 | return ocfs2_read_blocks(inode, blkno, |
3172 | blk_per_bucket, bhs, | 3168 | blk_per_bucket, bhs, |
3173 | OCFS2_BH_CACHED, inode); | 3169 | OCFS2_BH_CACHED); |
3174 | 3170 | ||
3175 | for (i = 0; i < blk_per_bucket; i++) { | 3171 | for (i = 0; i < blk_per_bucket; i++) { |
3176 | bhs[i] = sb_getblk(inode->i_sb, blkno + i); | 3172 | bhs[i] = sb_getblk(inode->i_sb, blkno + i); |
@@ -3485,7 +3481,7 @@ static int ocfs2_cp_xattr_cluster(struct inode *inode, | |||
3485 | ocfs2_journal_dirty(handle, first_bh); | 3481 | ocfs2_journal_dirty(handle, first_bh); |
3486 | 3482 | ||
3487 | /* update the new bucket header. */ | 3483 | /* update the new bucket header. */ |
3488 | ret = ocfs2_read_block(osb, to_blk_start, &bh, OCFS2_BH_CACHED, inode); | 3484 | ret = ocfs2_read_block(inode, to_blk_start, &bh, OCFS2_BH_CACHED); |
3489 | if (ret < 0) { | 3485 | if (ret < 0) { |
3490 | mlog_errno(ret); | 3486 | mlog_errno(ret); |
3491 | goto out; | 3487 | goto out; |
@@ -3872,8 +3868,8 @@ static int ocfs2_add_new_xattr_bucket(struct inode *inode, | |||
3872 | goto out; | 3868 | goto out; |
3873 | } | 3869 | } |
3874 | 3870 | ||
3875 | ret = ocfs2_read_block(osb, p_blkno, | 3871 | ret = ocfs2_read_block(inode, p_blkno, |
3876 | &first_bh, OCFS2_BH_CACHED, inode); | 3872 | &first_bh, OCFS2_BH_CACHED); |
3877 | if (ret) { | 3873 | if (ret) { |
3878 | mlog_errno(ret); | 3874 | mlog_errno(ret); |
3879 | goto out; | 3875 | goto out; |
@@ -4115,10 +4111,10 @@ static int ocfs2_xattr_set_entry_in_bucket(struct inode *inode, | |||
4115 | (unsigned long long)xs->bucket.bhs[0]->b_blocknr); | 4111 | (unsigned long long)xs->bucket.bhs[0]->b_blocknr); |
4116 | 4112 | ||
4117 | if (!xs->bucket.bhs[1]) { | 4113 | if (!xs->bucket.bhs[1]) { |
4118 | ret = ocfs2_read_blocks(osb, | 4114 | ret = ocfs2_read_blocks(inode, |
4119 | xs->bucket.bhs[0]->b_blocknr + 1, | 4115 | xs->bucket.bhs[0]->b_blocknr + 1, |
4120 | blk_per_bucket - 1, &xs->bucket.bhs[1], | 4116 | blk_per_bucket - 1, &xs->bucket.bhs[1], |
4121 | OCFS2_BH_CACHED, inode); | 4117 | OCFS2_BH_CACHED); |
4122 | if (ret) { | 4118 | if (ret) { |
4123 | mlog_errno(ret); | 4119 | mlog_errno(ret); |
4124 | goto out; | 4120 | goto out; |
@@ -4224,8 +4220,8 @@ static int ocfs2_xattr_bucket_value_truncate(struct inode *inode, | |||
4224 | BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize); | 4220 | BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize); |
4225 | value_blk += header_bh->b_blocknr; | 4221 | value_blk += header_bh->b_blocknr; |
4226 | 4222 | ||
4227 | ret = ocfs2_read_block(OCFS2_SB(inode->i_sb), value_blk, | 4223 | ret = ocfs2_read_block(inode, value_blk, |
4228 | &value_bh, OCFS2_BH_CACHED, inode); | 4224 | &value_bh, OCFS2_BH_CACHED); |
4229 | if (ret) { | 4225 | if (ret) { |
4230 | mlog_errno(ret); | 4226 | mlog_errno(ret); |
4231 | goto out; | 4227 | goto out; |