diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-03-25 22:09:15 -0400 |
---|---|---|
committer | Tao Ma <tao.ma@oracle.com> | 2010-03-25 22:09:15 -0400 |
commit | 2b6cb576aa80611f1f6a3c88708d1e68a8d97985 (patch) | |
tree | a984f09104970133379e4d370b9f01e7f85c6f9b /fs/ocfs2/xattr.c | |
parent | ba2066351b630f0205ebf725f5c81a2a07a77cd7 (diff) |
ocfs2: Set suballoc_loc on allocated metadata.
Get the suballoc_loc from ocfs2_claim_new_inode() or
ocfs2_claim_metadata(). Store it on the appropriate field of the block
we just allocated.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 2f6fd48c0ba4..805167e226c1 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -2829,7 +2829,7 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
2829 | int ret; | 2829 | int ret; |
2830 | u16 suballoc_bit_start; | 2830 | u16 suballoc_bit_start; |
2831 | u32 num_got; | 2831 | u32 num_got; |
2832 | u64 first_blkno; | 2832 | u64 suballoc_loc, first_blkno; |
2833 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)inode_bh->b_data; | 2833 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)inode_bh->b_data; |
2834 | struct buffer_head *new_bh = NULL; | 2834 | struct buffer_head *new_bh = NULL; |
2835 | struct ocfs2_xattr_block *xblk; | 2835 | struct ocfs2_xattr_block *xblk; |
@@ -2842,8 +2842,8 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
2842 | } | 2842 | } |
2843 | 2843 | ||
2844 | ret = ocfs2_claim_metadata(ctxt->handle, ctxt->meta_ac, 1, | 2844 | ret = ocfs2_claim_metadata(ctxt->handle, ctxt->meta_ac, 1, |
2845 | &suballoc_bit_start, &num_got, | 2845 | &suballoc_loc, &suballoc_bit_start, |
2846 | &first_blkno); | 2846 | &num_got, &first_blkno); |
2847 | if (ret < 0) { | 2847 | if (ret < 0) { |
2848 | mlog_errno(ret); | 2848 | mlog_errno(ret); |
2849 | goto end; | 2849 | goto end; |
@@ -2865,6 +2865,7 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
2865 | memset(xblk, 0, inode->i_sb->s_blocksize); | 2865 | memset(xblk, 0, inode->i_sb->s_blocksize); |
2866 | strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); | 2866 | strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); |
2867 | xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot); | 2867 | xblk->xb_suballoc_slot = cpu_to_le16(ctxt->meta_ac->ac_alloc_slot); |
2868 | xblk->xb_suballoc_loc = cpu_to_le64(suballoc_loc); | ||
2868 | xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); | 2869 | xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); |
2869 | xblk->xb_fs_generation = | 2870 | xblk->xb_fs_generation = |
2870 | cpu_to_le32(OCFS2_SB(inode->i_sb)->fs_generation); | 2871 | cpu_to_le32(OCFS2_SB(inode->i_sb)->fs_generation); |