diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-05-18 19:40:42 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-05-18 19:40:42 -0400 |
commit | 41841b0bcea8af7f3bff8b2a23d542b94d9c1bb1 (patch) | |
tree | 89eddf2dffadbbd13939f94eb8cd904a26279390 /fs/ocfs2/dir.c | |
parent | 316ce2ba8e74a7bb9153b9f93adc883cb1ceb9fd (diff) | |
parent | 1a934c3e57594588c373aea858e4593cdfcba4f4 (diff) |
Merge branch 'discontig-bg' of git://oss.oracle.com/git/tma/linux-2.6 into ocfs2-merge-window
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r-- | fs/ocfs2/dir.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 4a75c2e2f855..f04ebcfffc4a 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(osb, 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); |
@@ -2544,7 +2545,7 @@ static int __ocfs2_dx_dir_new_cluster(struct inode *dir, | |||
2544 | * chance of contiguousness as the directory grows in number | 2545 | * chance of contiguousness as the directory grows in number |
2545 | * of entries. | 2546 | * of entries. |
2546 | */ | 2547 | */ |
2547 | ret = __ocfs2_claim_clusters(osb, handle, data_ac, 1, 1, &phys, &num); | 2548 | ret = __ocfs2_claim_clusters(handle, data_ac, 1, 1, &phys, &num); |
2548 | if (ret) { | 2549 | if (ret) { |
2549 | mlog_errno(ret); | 2550 | mlog_errno(ret); |
2550 | goto out; | 2551 | goto out; |
@@ -2979,7 +2980,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
2979 | */ | 2980 | */ |
2980 | if (ocfs2_dir_resv_allowed(osb)) | 2981 | if (ocfs2_dir_resv_allowed(osb)) |
2981 | data_ac->ac_resv = &oi->ip_la_data_resv; | 2982 | data_ac->ac_resv = &oi->ip_la_data_resv; |
2982 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, &len); | 2983 | ret = ocfs2_claim_clusters(handle, data_ac, 1, &bit_off, &len); |
2983 | if (ret) { | 2984 | if (ret) { |
2984 | mlog_errno(ret); | 2985 | mlog_errno(ret); |
2985 | goto out_commit; | 2986 | goto out_commit; |
@@ -3118,7 +3119,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
3118 | * pass. Claim the 2nd cluster as a separate extent. | 3119 | * pass. Claim the 2nd cluster as a separate extent. |
3119 | */ | 3120 | */ |
3120 | if (alloc > len) { | 3121 | if (alloc > len) { |
3121 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, | 3122 | ret = ocfs2_claim_clusters(handle, data_ac, 1, &bit_off, |
3122 | &len); | 3123 | &len); |
3123 | if (ret) { | 3124 | if (ret) { |
3124 | mlog_errno(ret); | 3125 | mlog_errno(ret); |
@@ -4465,7 +4466,10 @@ static int ocfs2_dx_dir_remove_index(struct inode *dir, | |||
4465 | 4466 | ||
4466 | blk = le64_to_cpu(dx_root->dr_blkno); | 4467 | blk = le64_to_cpu(dx_root->dr_blkno); |
4467 | bit = le16_to_cpu(dx_root->dr_suballoc_bit); | 4468 | bit = le16_to_cpu(dx_root->dr_suballoc_bit); |
4468 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | 4469 | if (dx_root->dr_suballoc_loc) |
4470 | bg_blkno = le64_to_cpu(dx_root->dr_suballoc_loc); | ||
4471 | else | ||
4472 | bg_blkno = ocfs2_which_suballoc_group(blk, bit); | ||
4469 | ret = ocfs2_free_suballoc_bits(handle, dx_alloc_inode, dx_alloc_bh, | 4473 | ret = ocfs2_free_suballoc_bits(handle, dx_alloc_inode, dx_alloc_bh, |
4470 | bit, bg_blkno, 1); | 4474 | bit, bg_blkno, 1); |
4471 | if (ret) | 4475 | if (ret) |