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/dir.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/dir.c')
-rw-r--r-- | fs/ocfs2/dir.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 02c3f2261550..341bb8f811e9 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -2395,15 +2395,15 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, | |||
2395 | int ret; | 2395 | int ret; |
2396 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data; | 2396 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data; |
2397 | u16 dr_suballoc_bit; | 2397 | u16 dr_suballoc_bit; |
2398 | u64 dr_blkno; | 2398 | u64 suballoc_loc, dr_blkno; |
2399 | unsigned int num_bits; | 2399 | unsigned int num_bits; |
2400 | struct buffer_head *dx_root_bh = NULL; | 2400 | struct buffer_head *dx_root_bh = NULL; |
2401 | struct ocfs2_dx_root_block *dx_root; | 2401 | struct ocfs2_dx_root_block *dx_root; |
2402 | struct ocfs2_dir_block_trailer *trailer = | 2402 | struct ocfs2_dir_block_trailer *trailer = |
2403 | ocfs2_trailer_from_bh(dirdata_bh, dir->i_sb); | 2403 | ocfs2_trailer_from_bh(dirdata_bh, dir->i_sb); |
2404 | 2404 | ||
2405 | ret = ocfs2_claim_metadata(handle, meta_ac, 1, &dr_suballoc_bit, | 2405 | ret = ocfs2_claim_metadata(handle, meta_ac, 1, &suballoc_loc, |
2406 | &num_bits, &dr_blkno); | 2406 | &dr_suballoc_bit, &num_bits, &dr_blkno); |
2407 | if (ret) { | 2407 | if (ret) { |
2408 | mlog_errno(ret); | 2408 | mlog_errno(ret); |
2409 | goto out; | 2409 | goto out; |
@@ -2431,6 +2431,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, | |||
2431 | memset(dx_root, 0, osb->sb->s_blocksize); | 2431 | memset(dx_root, 0, osb->sb->s_blocksize); |
2432 | strcpy(dx_root->dr_signature, OCFS2_DX_ROOT_SIGNATURE); | 2432 | strcpy(dx_root->dr_signature, OCFS2_DX_ROOT_SIGNATURE); |
2433 | dx_root->dr_suballoc_slot = cpu_to_le16(meta_ac->ac_alloc_slot); | 2433 | dx_root->dr_suballoc_slot = cpu_to_le16(meta_ac->ac_alloc_slot); |
2434 | dx_root->dr_suballoc_loc = cpu_to_le64(suballoc_loc); | ||
2434 | dx_root->dr_suballoc_bit = cpu_to_le16(dr_suballoc_bit); | 2435 | dx_root->dr_suballoc_bit = cpu_to_le16(dr_suballoc_bit); |
2435 | dx_root->dr_fs_generation = cpu_to_le32(osb->fs_generation); | 2436 | dx_root->dr_fs_generation = cpu_to_le32(osb->fs_generation); |
2436 | dx_root->dr_blkno = cpu_to_le64(dr_blkno); | 2437 | dx_root->dr_blkno = cpu_to_le64(dr_blkno); |