diff options
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 63037bd7892f..c25780a70dfd 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -537,9 +537,7 @@ 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(inode, | 540 | ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh); |
541 | le64_to_cpu(di->i_xattr_loc), | ||
542 | &blk_bh, OCFS2_BH_CACHED); | ||
543 | if (ret < 0) { | 541 | if (ret < 0) { |
544 | mlog_errno(ret); | 542 | mlog_errno(ret); |
545 | return ret; | 543 | return ret; |
@@ -672,8 +670,7 @@ static int ocfs2_xattr_get_value_outside(struct inode *inode, | |||
672 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); | 670 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); |
673 | /* Copy ocfs2_xattr_value */ | 671 | /* Copy ocfs2_xattr_value */ |
674 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { | 672 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { |
675 | ret = ocfs2_read_block(inode, blkno, | 673 | ret = ocfs2_read_block(inode, blkno, &bh); |
676 | &bh, OCFS2_BH_CACHED); | ||
677 | if (ret) { | 674 | if (ret) { |
678 | mlog_errno(ret); | 675 | mlog_errno(ret); |
679 | goto out; | 676 | goto out; |
@@ -764,9 +761,7 @@ static int ocfs2_xattr_block_get(struct inode *inode, | |||
764 | 761 | ||
765 | memset(&xs->bucket, 0, sizeof(xs->bucket)); | 762 | memset(&xs->bucket, 0, sizeof(xs->bucket)); |
766 | 763 | ||
767 | ret = ocfs2_read_block(inode, | 764 | ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh); |
768 | le64_to_cpu(di->i_xattr_loc), | ||
769 | &blk_bh, OCFS2_BH_CACHED); | ||
770 | if (ret < 0) { | 765 | if (ret < 0) { |
771 | mlog_errno(ret); | 766 | mlog_errno(ret); |
772 | return ret; | 767 | return ret; |
@@ -922,8 +917,7 @@ static int __ocfs2_xattr_set_value_outside(struct inode *inode, | |||
922 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); | 917 | blkno = ocfs2_clusters_to_blocks(inode->i_sb, p_cluster); |
923 | 918 | ||
924 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { | 919 | for (i = 0; i < num_clusters * bpc; i++, blkno++) { |
925 | ret = ocfs2_read_block(inode, blkno, | 920 | ret = ocfs2_read_block(inode, blkno, &bh); |
926 | &bh, OCFS2_BH_CACHED); | ||
927 | if (ret) { | 921 | if (ret) { |
928 | mlog_errno(ret); | 922 | mlog_errno(ret); |
929 | goto out_commit; | 923 | goto out_commit; |
@@ -1514,8 +1508,7 @@ static int ocfs2_xattr_free_block(struct inode *inode, | |||
1514 | u64 blk, bg_blkno; | 1508 | u64 blk, bg_blkno; |
1515 | u16 bit; | 1509 | u16 bit; |
1516 | 1510 | ||
1517 | ret = ocfs2_read_block(inode, block, &blk_bh, | 1511 | ret = ocfs2_read_block(inode, block, &blk_bh); |
1518 | OCFS2_BH_CACHED); | ||
1519 | if (ret < 0) { | 1512 | if (ret < 0) { |
1520 | mlog_errno(ret); | 1513 | mlog_errno(ret); |
1521 | goto out; | 1514 | goto out; |
@@ -1773,9 +1766,7 @@ static int ocfs2_xattr_block_find(struct inode *inode, | |||
1773 | if (!di->i_xattr_loc) | 1766 | if (!di->i_xattr_loc) |
1774 | return ret; | 1767 | return ret; |
1775 | 1768 | ||
1776 | ret = ocfs2_read_block(inode, | 1769 | ret = ocfs2_read_block(inode, le64_to_cpu(di->i_xattr_loc), &blk_bh); |
1777 | le64_to_cpu(di->i_xattr_loc), | ||
1778 | &blk_bh, OCFS2_BH_CACHED); | ||
1779 | if (ret < 0) { | 1770 | if (ret < 0) { |
1780 | mlog_errno(ret); | 1771 | mlog_errno(ret); |
1781 | return ret; | 1772 | return ret; |
@@ -2216,9 +2207,8 @@ static int ocfs2_find_xe_in_bucket(struct inode *inode, | |||
2216 | break; | 2207 | break; |
2217 | } | 2208 | } |
2218 | 2209 | ||
2219 | ret = ocfs2_read_block(inode, | 2210 | ret = ocfs2_read_block(inode, header_bh->b_blocknr + block_off, |
2220 | header_bh->b_blocknr + block_off, | 2211 | &name_bh); |
2221 | &name_bh, OCFS2_BH_CACHED); | ||
2222 | if (ret) { | 2212 | if (ret) { |
2223 | mlog_errno(ret); | 2213 | mlog_errno(ret); |
2224 | break; | 2214 | break; |
@@ -2269,7 +2259,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode, | |||
2269 | u32 last_hash; | 2259 | u32 last_hash; |
2270 | u64 blkno; | 2260 | u64 blkno; |
2271 | 2261 | ||
2272 | ret = ocfs2_read_block(inode, p_blkno, &bh, OCFS2_BH_CACHED); | 2262 | ret = ocfs2_read_block(inode, p_blkno, &bh); |
2273 | if (ret) { | 2263 | if (ret) { |
2274 | mlog_errno(ret); | 2264 | mlog_errno(ret); |
2275 | goto out; | 2265 | goto out; |
@@ -2285,7 +2275,7 @@ static int ocfs2_xattr_bucket_find(struct inode *inode, | |||
2285 | 2275 | ||
2286 | blkno = p_blkno + bucket * blk_per_bucket; | 2276 | blkno = p_blkno + bucket * blk_per_bucket; |
2287 | 2277 | ||
2288 | ret = ocfs2_read_block(inode, blkno, &bh, OCFS2_BH_CACHED); | 2278 | ret = ocfs2_read_block(inode, blkno, &bh); |
2289 | if (ret) { | 2279 | if (ret) { |
2290 | mlog_errno(ret); | 2280 | mlog_errno(ret); |
2291 | goto out; | 2281 | goto out; |
@@ -2898,7 +2888,6 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode, | |||
2898 | u64 blkno = bucket->bhs[0]->b_blocknr; | 2888 | u64 blkno = bucket->bhs[0]->b_blocknr; |
2899 | u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); | 2889 | u16 blk_per_bucket = ocfs2_blocks_per_xattr_bucket(inode->i_sb); |
2900 | u16 xh_free_start; | 2890 | u16 xh_free_start; |
2901 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
2902 | size_t blocksize = inode->i_sb->s_blocksize; | 2891 | size_t blocksize = inode->i_sb->s_blocksize; |
2903 | handle_t *handle; | 2892 | handle_t *handle; |
2904 | struct buffer_head **bhs; | 2893 | struct buffer_head **bhs; |
@@ -3110,8 +3099,7 @@ static int ocfs2_mv_xattr_bucket_cross_cluster(struct inode *inode, | |||
3110 | goto out; | 3099 | goto out; |
3111 | } | 3100 | } |
3112 | 3101 | ||
3113 | ret = ocfs2_read_block(inode, prev_blkno, | 3102 | ret = ocfs2_read_block(inode, prev_blkno, &old_bh); |
3114 | &old_bh, OCFS2_BH_CACHED); | ||
3115 | if (ret < 0) { | 3103 | if (ret < 0) { |
3116 | mlog_errno(ret); | 3104 | mlog_errno(ret); |
3117 | brelse(new_bh); | 3105 | brelse(new_bh); |
@@ -3481,7 +3469,7 @@ static int ocfs2_cp_xattr_cluster(struct inode *inode, | |||
3481 | ocfs2_journal_dirty(handle, first_bh); | 3469 | ocfs2_journal_dirty(handle, first_bh); |
3482 | 3470 | ||
3483 | /* update the new bucket header. */ | 3471 | /* update the new bucket header. */ |
3484 | ret = ocfs2_read_block(inode, to_blk_start, &bh, OCFS2_BH_CACHED); | 3472 | ret = ocfs2_read_block(inode, to_blk_start, &bh); |
3485 | if (ret < 0) { | 3473 | if (ret < 0) { |
3486 | mlog_errno(ret); | 3474 | mlog_errno(ret); |
3487 | goto out; | 3475 | goto out; |
@@ -3868,8 +3856,7 @@ static int ocfs2_add_new_xattr_bucket(struct inode *inode, | |||
3868 | goto out; | 3856 | goto out; |
3869 | } | 3857 | } |
3870 | 3858 | ||
3871 | ret = ocfs2_read_block(inode, p_blkno, | 3859 | ret = ocfs2_read_block(inode, p_blkno, &first_bh); |
3872 | &first_bh, OCFS2_BH_CACHED); | ||
3873 | if (ret) { | 3860 | if (ret) { |
3874 | mlog_errno(ret); | 3861 | mlog_errno(ret); |
3875 | goto out; | 3862 | goto out; |
@@ -4220,8 +4207,7 @@ static int ocfs2_xattr_bucket_value_truncate(struct inode *inode, | |||
4220 | BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize); | 4207 | BUG_ON(value_blk != (offset + OCFS2_XATTR_ROOT_SIZE - 1) / blocksize); |
4221 | value_blk += header_bh->b_blocknr; | 4208 | value_blk += header_bh->b_blocknr; |
4222 | 4209 | ||
4223 | ret = ocfs2_read_block(inode, value_blk, | 4210 | ret = ocfs2_read_block(inode, value_blk, &value_bh); |
4224 | &value_bh, OCFS2_BH_CACHED); | ||
4225 | if (ret) { | 4211 | if (ret) { |
4226 | mlog_errno(ret); | 4212 | mlog_errno(ret); |
4227 | goto out; | 4213 | goto out; |