aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2010-05-18 19:40:42 -0400
committerJoel Becker <joel.becker@oracle.com>2010-05-18 19:40:42 -0400
commit41841b0bcea8af7f3bff8b2a23d542b94d9c1bb1 (patch)
tree89eddf2dffadbbd13939f94eb8cd904a26279390 /fs/ocfs2/xattr.c
parent316ce2ba8e74a7bb9153b9f93adc883cb1ceb9fd (diff)
parent1a934c3e57594588c373aea858e4593cdfcba4f4 (diff)
Merge branch 'discontig-bg' of git://oss.oracle.com/git/tma/linux-2.6 into ocfs2-merge-window
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 38a55ff45b3a..a1cf195935cf 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -2466,7 +2466,10 @@ static int ocfs2_xattr_free_block(struct inode *inode,
2466 xb = (struct ocfs2_xattr_block *)blk_bh->b_data; 2466 xb = (struct ocfs2_xattr_block *)blk_bh->b_data;
2467 blk = le64_to_cpu(xb->xb_blkno); 2467 blk = le64_to_cpu(xb->xb_blkno);
2468 bit = le16_to_cpu(xb->xb_suballoc_bit); 2468 bit = le16_to_cpu(xb->xb_suballoc_bit);
2469 bg_blkno = ocfs2_which_suballoc_group(blk, bit); 2469 if (xb->xb_suballoc_loc)
2470 bg_blkno = le64_to_cpu(xb->xb_suballoc_loc);
2471 else
2472 bg_blkno = ocfs2_which_suballoc_group(blk, bit);
2470 2473
2471 xb_alloc_inode = ocfs2_get_system_file_inode(osb, 2474 xb_alloc_inode = ocfs2_get_system_file_inode(osb,
2472 EXTENT_ALLOC_SYSTEM_INODE, 2475 EXTENT_ALLOC_SYSTEM_INODE,
@@ -2829,9 +2832,8 @@ static int ocfs2_create_xattr_block(struct inode *inode,
2829 int ret; 2832 int ret;
2830 u16 suballoc_bit_start; 2833 u16 suballoc_bit_start;
2831 u32 num_got; 2834 u32 num_got;
2832 u64 first_blkno; 2835 u64 suballoc_loc, first_blkno;
2833 struct ocfs2_dinode *di = (struct ocfs2_dinode *)inode_bh->b_data; 2836 struct ocfs2_dinode *di = (struct ocfs2_dinode *)inode_bh->b_data;
2834 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
2835 struct buffer_head *new_bh = NULL; 2837 struct buffer_head *new_bh = NULL;
2836 struct ocfs2_xattr_block *xblk; 2838 struct ocfs2_xattr_block *xblk;
2837 2839
@@ -2842,9 +2844,9 @@ static int ocfs2_create_xattr_block(struct inode *inode,
2842 goto end; 2844 goto end;
2843 } 2845 }
2844 2846
2845 ret = ocfs2_claim_metadata(osb, ctxt->handle, ctxt->meta_ac, 1, 2847 ret = ocfs2_claim_metadata(ctxt->handle, ctxt->meta_ac, 1,
2846 &suballoc_bit_start, &num_got, 2848 &suballoc_loc, &suballoc_bit_start,
2847 &first_blkno); 2849 &num_got, &first_blkno);
2848 if (ret < 0) { 2850 if (ret < 0) {
2849 mlog_errno(ret); 2851 mlog_errno(ret);
2850 goto end; 2852 goto end;
@@ -2866,8 +2868,10 @@ static int ocfs2_create_xattr_block(struct inode *inode,
2866 memset(xblk, 0, inode->i_sb->s_blocksize); 2868 memset(xblk, 0, inode->i_sb->s_blocksize);
2867 strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); 2869 strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE);
2868 xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot); 2870 xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot);
2871 xblk->xb_suballoc_loc = cpu_to_le64(suballoc_loc);
2869 xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); 2872 xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start);
2870 xblk->xb_fs_generation = cpu_to_le32(osb->fs_generation); 2873 xblk->xb_fs_generation =
2874 cpu_to_le32(OCFS2_SB(inode->i_sb)->fs_generation);
2871 xblk->xb_blkno = cpu_to_le64(first_blkno); 2875 xblk->xb_blkno = cpu_to_le64(first_blkno);
2872 if (indexed) { 2876 if (indexed) {
2873 struct ocfs2_xattr_tree_root *xr = &xblk->xb_attrs.xb_root; 2877 struct ocfs2_xattr_tree_root *xr = &xblk->xb_attrs.xb_root;
@@ -4229,7 +4233,6 @@ static int ocfs2_xattr_create_index_block(struct inode *inode,
4229 u32 bit_off, len; 4233 u32 bit_off, len;
4230 u64 blkno; 4234 u64 blkno;
4231 handle_t *handle = ctxt->handle; 4235 handle_t *handle = ctxt->handle;
4232 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
4233 struct ocfs2_inode_info *oi = OCFS2_I(inode); 4236 struct ocfs2_inode_info *oi = OCFS2_I(inode);
4234 struct buffer_head *xb_bh = xs->xattr_bh; 4237 struct buffer_head *xb_bh = xs->xattr_bh;
4235 struct ocfs2_xattr_block *xb = 4238 struct ocfs2_xattr_block *xb =
@@ -4257,7 +4260,7 @@ static int ocfs2_xattr_create_index_block(struct inode *inode,
4257 goto out; 4260 goto out;
4258 } 4261 }
4259 4262
4260 ret = __ocfs2_claim_clusters(osb, handle, ctxt->data_ac, 4263 ret = __ocfs2_claim_clusters(handle, ctxt->data_ac,
4261 1, 1, &bit_off, &len); 4264 1, 1, &bit_off, &len);
4262 if (ret) { 4265 if (ret) {
4263 mlog_errno(ret); 4266 mlog_errno(ret);
@@ -5078,7 +5081,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode,
5078 goto leave; 5081 goto leave;
5079 } 5082 }
5080 5083
5081 ret = __ocfs2_claim_clusters(osb, handle, ctxt->data_ac, 1, 5084 ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, 1,
5082 clusters_to_add, &bit_off, &num_bits); 5085 clusters_to_add, &bit_off, &num_bits);
5083 if (ret < 0) { 5086 if (ret < 0) {
5084 if (ret != -ENOSPC) 5087 if (ret != -ENOSPC)
@@ -6906,7 +6909,7 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode,
6906 goto out; 6909 goto out;
6907 } 6910 }
6908 6911
6909 ret = ocfs2_claim_clusters(osb, handle, data_ac, 6912 ret = ocfs2_claim_clusters(handle, data_ac,
6910 len, &p_cluster, &num_clusters); 6913 len, &p_cluster, &num_clusters);
6911 if (ret) { 6914 if (ret) {
6912 mlog_errno(ret); 6915 mlog_errno(ret);