diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-05-06 01:59:06 -0400 |
---|---|---|
committer | Tao Ma <tao.ma@oracle.com> | 2010-05-06 01:59:06 -0400 |
commit | 1ed9b777f77929ae961d6f9cdf828a07200ba71c (patch) | |
tree | a0bb6c9e9be1f5d3d46d6cdac0a4397303e22795 /fs/ocfs2 | |
parent | 13e434cf0cacd2f03a7f4cd077e3e995ef5ef710 (diff) |
ocfs2: ocfs2_claim_*() don't need an ocfs2_super argument.
They all take an ocfs2_alloc_context, which has the allocation inode.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/alloc.c | 7 | ||||
-rw-r--r-- | fs/ocfs2/dir.c | 8 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/namei.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/refcounttree.c | 8 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.c | 23 | ||||
-rw-r--r-- | fs/ocfs2/suballoc.h | 12 | ||||
-rw-r--r-- | fs/ocfs2/xattr.c | 13 |
8 files changed, 34 insertions, 43 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 0cb2945eb817..b6e2ba1f6a7b 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -1015,8 +1015,7 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle, | |||
1015 | 1015 | ||
1016 | count = 0; | 1016 | count = 0; |
1017 | while (count < wanted) { | 1017 | while (count < wanted) { |
1018 | status = ocfs2_claim_metadata(osb, | 1018 | status = ocfs2_claim_metadata(handle, |
1019 | handle, | ||
1020 | meta_ac, | 1019 | meta_ac, |
1021 | wanted - count, | 1020 | wanted - count, |
1022 | &suballoc_bit_start, | 1021 | &suballoc_bit_start, |
@@ -4786,7 +4785,7 @@ int ocfs2_add_clusters_in_btree(handle_t *handle, | |||
4786 | goto leave; | 4785 | goto leave; |
4787 | } | 4786 | } |
4788 | 4787 | ||
4789 | status = __ocfs2_claim_clusters(osb, handle, data_ac, 1, | 4788 | status = __ocfs2_claim_clusters(handle, data_ac, 1, |
4790 | clusters_to_add, &bit_off, &num_bits); | 4789 | clusters_to_add, &bit_off, &num_bits); |
4791 | if (status < 0) { | 4790 | if (status < 0) { |
4792 | if (status != -ENOSPC) | 4791 | if (status != -ENOSPC) |
@@ -7201,7 +7200,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, | |||
7201 | 7200 | ||
7202 | data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv; | 7201 | data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv; |
7203 | 7202 | ||
7204 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, | 7203 | ret = ocfs2_claim_clusters(handle, data_ac, 1, &bit_off, |
7205 | &num); | 7204 | &num); |
7206 | if (ret) { | 7205 | if (ret) { |
7207 | mlog_errno(ret); | 7206 | mlog_errno(ret); |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 6c9a28a2d3ae..02c3f2261550 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -2402,7 +2402,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, | |||
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, &dr_suballoc_bit, |
2406 | &num_bits, &dr_blkno); | 2406 | &num_bits, &dr_blkno); |
2407 | if (ret) { | 2407 | if (ret) { |
2408 | mlog_errno(ret); | 2408 | mlog_errno(ret); |
@@ -2544,7 +2544,7 @@ static int __ocfs2_dx_dir_new_cluster(struct inode *dir, | |||
2544 | * chance of contiguousness as the directory grows in number | 2544 | * chance of contiguousness as the directory grows in number |
2545 | * of entries. | 2545 | * of entries. |
2546 | */ | 2546 | */ |
2547 | ret = __ocfs2_claim_clusters(osb, handle, data_ac, 1, 1, &phys, &num); | 2547 | ret = __ocfs2_claim_clusters(handle, data_ac, 1, 1, &phys, &num); |
2548 | if (ret) { | 2548 | if (ret) { |
2549 | mlog_errno(ret); | 2549 | mlog_errno(ret); |
2550 | goto out; | 2550 | goto out; |
@@ -2979,7 +2979,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, | |||
2979 | */ | 2979 | */ |
2980 | if (ocfs2_dir_resv_allowed(osb)) | 2980 | if (ocfs2_dir_resv_allowed(osb)) |
2981 | data_ac->ac_resv = &oi->ip_la_data_resv; | 2981 | data_ac->ac_resv = &oi->ip_la_data_resv; |
2982 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, &len); | 2982 | ret = ocfs2_claim_clusters(handle, data_ac, 1, &bit_off, &len); |
2983 | if (ret) { | 2983 | if (ret) { |
2984 | mlog_errno(ret); | 2984 | mlog_errno(ret); |
2985 | goto out_commit; | 2985 | goto out_commit; |
@@ -3118,7 +3118,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. | 3118 | * pass. Claim the 2nd cluster as a separate extent. |
3119 | */ | 3119 | */ |
3120 | if (alloc > len) { | 3120 | if (alloc > len) { |
3121 | ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, &bit_off, | 3121 | ret = ocfs2_claim_clusters(handle, data_ac, 1, &bit_off, |
3122 | &len); | 3122 | &len); |
3123 | if (ret) { | 3123 | if (ret) { |
3124 | mlog_errno(ret); | 3124 | mlog_errno(ret); |
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 9538bbe028d4..aab1b634cc8e 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c | |||
@@ -1161,7 +1161,7 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb, | |||
1161 | /* we used the generic suballoc reserve function, but we set | 1161 | /* we used the generic suballoc reserve function, but we set |
1162 | * everything up nicely, so there's no reason why we can't use | 1162 | * everything up nicely, so there's no reason why we can't use |
1163 | * the more specific cluster api to claim bits. */ | 1163 | * the more specific cluster api to claim bits. */ |
1164 | status = ocfs2_claim_clusters(osb, handle, ac, osb->local_alloc_bits, | 1164 | status = ocfs2_claim_clusters(handle, ac, osb->local_alloc_bits, |
1165 | &cluster_off, &cluster_count); | 1165 | &cluster_off, &cluster_count); |
1166 | if (status == -ENOSPC) { | 1166 | if (status == -ENOSPC) { |
1167 | retry_enospc: | 1167 | retry_enospc: |
@@ -1175,7 +1175,7 @@ retry_enospc: | |||
1175 | goto bail; | 1175 | goto bail; |
1176 | 1176 | ||
1177 | ac->ac_bits_wanted = osb->local_alloc_default_bits; | 1177 | ac->ac_bits_wanted = osb->local_alloc_default_bits; |
1178 | status = ocfs2_claim_clusters(osb, handle, ac, | 1178 | status = ocfs2_claim_clusters(handle, ac, |
1179 | osb->local_alloc_bits, | 1179 | osb->local_alloc_bits, |
1180 | &cluster_off, | 1180 | &cluster_off, |
1181 | &cluster_count); | 1181 | &cluster_count); |
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 21d4a33d0f0e..e5434a04b88a 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -478,7 +478,7 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb, | |||
478 | 478 | ||
479 | *new_fe_bh = NULL; | 479 | *new_fe_bh = NULL; |
480 | 480 | ||
481 | status = ocfs2_claim_new_inode(osb, handle, dir, parent_fe_bh, | 481 | status = ocfs2_claim_new_inode(handle, dir, parent_fe_bh, |
482 | inode_ac, &suballoc_bit, &fe_blkno); | 482 | inode_ac, &suballoc_bit, &fe_blkno); |
483 | if (status < 0) { | 483 | if (status < 0) { |
484 | mlog_errno(status); | 484 | mlog_errno(status); |
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 33dd2a18cb74..2bd74766c4e0 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -597,7 +597,7 @@ static int ocfs2_create_refcount_tree(struct inode *inode, | |||
597 | goto out_commit; | 597 | goto out_commit; |
598 | } | 598 | } |
599 | 599 | ||
600 | ret = ocfs2_claim_metadata(osb, handle, meta_ac, 1, | 600 | ret = ocfs2_claim_metadata(handle, meta_ac, 1, |
601 | &suballoc_bit_start, &num_got, | 601 | &suballoc_bit_start, &num_got, |
602 | &first_blkno); | 602 | &first_blkno); |
603 | if (ret) { | 603 | if (ret) { |
@@ -1297,7 +1297,7 @@ static int ocfs2_expand_inline_ref_root(handle_t *handle, | |||
1297 | goto out; | 1297 | goto out; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | ret = ocfs2_claim_metadata(OCFS2_SB(sb), handle, meta_ac, 1, | 1300 | ret = ocfs2_claim_metadata(handle, meta_ac, 1, |
1301 | &suballoc_bit_start, &num_got, | 1301 | &suballoc_bit_start, &num_got, |
1302 | &blkno); | 1302 | &blkno); |
1303 | if (ret) { | 1303 | if (ret) { |
@@ -1547,7 +1547,7 @@ static int ocfs2_new_leaf_refcount_block(handle_t *handle, | |||
1547 | goto out; | 1547 | goto out; |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | ret = ocfs2_claim_metadata(OCFS2_SB(sb), handle, meta_ac, 1, | 1550 | ret = ocfs2_claim_metadata(handle, meta_ac, 1, |
1551 | &suballoc_bit_start, &num_got, | 1551 | &suballoc_bit_start, &num_got, |
1552 | &blkno); | 1552 | &blkno); |
1553 | if (ret) { | 1553 | if (ret) { |
@@ -3271,7 +3271,7 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, | |||
3271 | } else { | 3271 | } else { |
3272 | delete = 1; | 3272 | delete = 1; |
3273 | 3273 | ||
3274 | ret = __ocfs2_claim_clusters(osb, handle, | 3274 | ret = __ocfs2_claim_clusters(handle, |
3275 | context->data_ac, | 3275 | context->data_ac, |
3276 | 1, set_len, | 3276 | 1, set_len, |
3277 | &new_bit, &new_len); | 3277 | &new_bit, &new_len); |
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index c9661c477869..3f6201777784 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -439,7 +439,7 @@ ocfs2_block_group_alloc_contig(struct ocfs2_super *osb, handle_t *handle, | |||
439 | struct buffer_head *bg_bh; | 439 | struct buffer_head *bg_bh; |
440 | unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); | 440 | unsigned int alloc_rec = ocfs2_find_smallest_chain(cl); |
441 | 441 | ||
442 | status = ocfs2_claim_clusters(osb, handle, ac, | 442 | status = ocfs2_claim_clusters(handle, ac, |
443 | le16_to_cpu(cl->cl_cpg), &bit_off, | 443 | le16_to_cpu(cl->cl_cpg), &bit_off, |
444 | &num_bits); | 444 | &num_bits); |
445 | if (status < 0) { | 445 | if (status < 0) { |
@@ -481,7 +481,7 @@ static int ocfs2_block_group_claim_bits(struct ocfs2_super *osb, | |||
481 | int status; | 481 | int status; |
482 | 482 | ||
483 | while (min_bits) { | 483 | while (min_bits) { |
484 | status = ocfs2_claim_clusters(osb, handle, ac, min_bits, | 484 | status = ocfs2_claim_clusters(handle, ac, min_bits, |
485 | bit_off, num_bits); | 485 | bit_off, num_bits); |
486 | if (status != -ENOSPC) | 486 | if (status != -ENOSPC) |
487 | break; | 487 | break; |
@@ -1919,8 +1919,7 @@ bail: | |||
1919 | return status; | 1919 | return status; |
1920 | } | 1920 | } |
1921 | 1921 | ||
1922 | int ocfs2_claim_metadata(struct ocfs2_super *osb, | 1922 | int ocfs2_claim_metadata(handle_t *handle, |
1923 | handle_t *handle, | ||
1924 | struct ocfs2_alloc_context *ac, | 1923 | struct ocfs2_alloc_context *ac, |
1925 | u32 bits_wanted, | 1924 | u32 bits_wanted, |
1926 | u16 *suballoc_bit_start, | 1925 | u16 *suballoc_bit_start, |
@@ -1943,7 +1942,7 @@ int ocfs2_claim_metadata(struct ocfs2_super *osb, | |||
1943 | mlog_errno(status); | 1942 | mlog_errno(status); |
1944 | goto bail; | 1943 | goto bail; |
1945 | } | 1944 | } |
1946 | atomic_inc(&osb->alloc_stats.bg_allocs); | 1945 | atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs); |
1947 | 1946 | ||
1948 | *suballoc_bit_start = res.sr_bit_offset; | 1947 | *suballoc_bit_start = res.sr_bit_offset; |
1949 | *blkno_start = res.sr_bg_blkno + (u64)(res.sr_bit_offset); | 1948 | *blkno_start = res.sr_bg_blkno + (u64)(res.sr_bit_offset); |
@@ -1986,8 +1985,7 @@ static inline void ocfs2_save_inode_ac_group(struct inode *dir, | |||
1986 | OCFS2_I(dir)->ip_last_used_slot = ac->ac_alloc_slot; | 1985 | OCFS2_I(dir)->ip_last_used_slot = ac->ac_alloc_slot; |
1987 | } | 1986 | } |
1988 | 1987 | ||
1989 | int ocfs2_claim_new_inode(struct ocfs2_super *osb, | 1988 | int ocfs2_claim_new_inode(handle_t *handle, |
1990 | handle_t *handle, | ||
1991 | struct inode *dir, | 1989 | struct inode *dir, |
1992 | struct buffer_head *parent_fe_bh, | 1990 | struct buffer_head *parent_fe_bh, |
1993 | struct ocfs2_alloc_context *ac, | 1991 | struct ocfs2_alloc_context *ac, |
@@ -2015,7 +2013,7 @@ int ocfs2_claim_new_inode(struct ocfs2_super *osb, | |||
2015 | mlog_errno(status); | 2013 | mlog_errno(status); |
2016 | goto bail; | 2014 | goto bail; |
2017 | } | 2015 | } |
2018 | atomic_inc(&osb->alloc_stats.bg_allocs); | 2016 | atomic_inc(&OCFS2_SB(ac->ac_inode->i_sb)->alloc_stats.bg_allocs); |
2019 | 2017 | ||
2020 | BUG_ON(res.sr_bits != 1); | 2018 | BUG_ON(res.sr_bits != 1); |
2021 | 2019 | ||
@@ -2090,8 +2088,7 @@ static inline void ocfs2_block_to_cluster_group(struct inode *inode, | |||
2090 | * contig. allocation, set to '1' to indicate we can deal with extents | 2088 | * contig. allocation, set to '1' to indicate we can deal with extents |
2091 | * of any size. | 2089 | * of any size. |
2092 | */ | 2090 | */ |
2093 | int __ocfs2_claim_clusters(struct ocfs2_super *osb, | 2091 | int __ocfs2_claim_clusters(handle_t *handle, |
2094 | handle_t *handle, | ||
2095 | struct ocfs2_alloc_context *ac, | 2092 | struct ocfs2_alloc_context *ac, |
2096 | u32 min_clusters, | 2093 | u32 min_clusters, |
2097 | u32 max_clusters, | 2094 | u32 max_clusters, |
@@ -2101,6 +2098,7 @@ int __ocfs2_claim_clusters(struct ocfs2_super *osb, | |||
2101 | int status; | 2098 | int status; |
2102 | unsigned int bits_wanted = max_clusters; | 2099 | unsigned int bits_wanted = max_clusters; |
2103 | struct ocfs2_suballoc_result res; | 2100 | struct ocfs2_suballoc_result res; |
2101 | struct ocfs2_super *osb = OCFS2_SB(ac->ac_inode->i_sb); | ||
2104 | 2102 | ||
2105 | mlog_entry_void(); | 2103 | mlog_entry_void(); |
2106 | 2104 | ||
@@ -2161,8 +2159,7 @@ bail: | |||
2161 | return status; | 2159 | return status; |
2162 | } | 2160 | } |
2163 | 2161 | ||
2164 | int ocfs2_claim_clusters(struct ocfs2_super *osb, | 2162 | int ocfs2_claim_clusters(handle_t *handle, |
2165 | handle_t *handle, | ||
2166 | struct ocfs2_alloc_context *ac, | 2163 | struct ocfs2_alloc_context *ac, |
2167 | u32 min_clusters, | 2164 | u32 min_clusters, |
2168 | u32 *cluster_start, | 2165 | u32 *cluster_start, |
@@ -2170,7 +2167,7 @@ int ocfs2_claim_clusters(struct ocfs2_super *osb, | |||
2170 | { | 2167 | { |
2171 | unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given; | 2168 | unsigned int bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given; |
2172 | 2169 | ||
2173 | return __ocfs2_claim_clusters(osb, handle, ac, min_clusters, | 2170 | return __ocfs2_claim_clusters(handle, ac, min_clusters, |
2174 | bits_wanted, cluster_start, num_clusters); | 2171 | bits_wanted, cluster_start, num_clusters); |
2175 | } | 2172 | } |
2176 | 2173 | ||
diff --git a/fs/ocfs2/suballoc.h b/fs/ocfs2/suballoc.h index f5a22cd1640f..49b0b22d30cf 100644 --- a/fs/ocfs2/suballoc.h +++ b/fs/ocfs2/suballoc.h | |||
@@ -83,22 +83,19 @@ int ocfs2_reserve_clusters(struct ocfs2_super *osb, | |||
83 | u32 bits_wanted, | 83 | u32 bits_wanted, |
84 | struct ocfs2_alloc_context **ac); | 84 | struct ocfs2_alloc_context **ac); |
85 | 85 | ||
86 | int ocfs2_claim_metadata(struct ocfs2_super *osb, | 86 | int ocfs2_claim_metadata(handle_t *handle, |
87 | handle_t *handle, | ||
88 | struct ocfs2_alloc_context *ac, | 87 | struct ocfs2_alloc_context *ac, |
89 | u32 bits_wanted, | 88 | u32 bits_wanted, |
90 | u16 *suballoc_bit_start, | 89 | u16 *suballoc_bit_start, |
91 | u32 *num_bits, | 90 | u32 *num_bits, |
92 | u64 *blkno_start); | 91 | u64 *blkno_start); |
93 | int ocfs2_claim_new_inode(struct ocfs2_super *osb, | 92 | int ocfs2_claim_new_inode(handle_t *handle, |
94 | handle_t *handle, | ||
95 | struct inode *dir, | 93 | struct inode *dir, |
96 | struct buffer_head *parent_fe_bh, | 94 | struct buffer_head *parent_fe_bh, |
97 | struct ocfs2_alloc_context *ac, | 95 | struct ocfs2_alloc_context *ac, |
98 | u16 *suballoc_bit, | 96 | u16 *suballoc_bit, |
99 | u64 *fe_blkno); | 97 | u64 *fe_blkno); |
100 | int ocfs2_claim_clusters(struct ocfs2_super *osb, | 98 | int ocfs2_claim_clusters(handle_t *handle, |
101 | handle_t *handle, | ||
102 | struct ocfs2_alloc_context *ac, | 99 | struct ocfs2_alloc_context *ac, |
103 | u32 min_clusters, | 100 | u32 min_clusters, |
104 | u32 *cluster_start, | 101 | u32 *cluster_start, |
@@ -107,8 +104,7 @@ int ocfs2_claim_clusters(struct ocfs2_super *osb, | |||
107 | * Use this variant of ocfs2_claim_clusters to specify a maxiumum | 104 | * Use this variant of ocfs2_claim_clusters to specify a maxiumum |
108 | * number of clusters smaller than the allocation reserved. | 105 | * number of clusters smaller than the allocation reserved. |
109 | */ | 106 | */ |
110 | int __ocfs2_claim_clusters(struct ocfs2_super *osb, | 107 | int __ocfs2_claim_clusters(handle_t *handle, |
111 | handle_t *handle, | ||
112 | struct ocfs2_alloc_context *ac, | 108 | struct ocfs2_alloc_context *ac, |
113 | u32 min_clusters, | 109 | u32 min_clusters, |
114 | u32 max_clusters, | 110 | u32 max_clusters, |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 38a55ff45b3a..2f6fd48c0ba4 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -2831,7 +2831,6 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
2831 | u32 num_got; | 2831 | u32 num_got; |
2832 | u64 first_blkno; | 2832 | u64 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 ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
2835 | struct buffer_head *new_bh = NULL; | 2834 | struct buffer_head *new_bh = NULL; |
2836 | struct ocfs2_xattr_block *xblk; | 2835 | struct ocfs2_xattr_block *xblk; |
2837 | 2836 | ||
@@ -2842,7 +2841,7 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
2842 | goto end; | 2841 | goto end; |
2843 | } | 2842 | } |
2844 | 2843 | ||
2845 | ret = ocfs2_claim_metadata(osb, ctxt->handle, ctxt->meta_ac, 1, | 2844 | ret = ocfs2_claim_metadata(ctxt->handle, ctxt->meta_ac, 1, |
2846 | &suballoc_bit_start, &num_got, | 2845 | &suballoc_bit_start, &num_got, |
2847 | &first_blkno); | 2846 | &first_blkno); |
2848 | if (ret < 0) { | 2847 | if (ret < 0) { |
@@ -2867,7 +2866,8 @@ static int ocfs2_create_xattr_block(struct inode *inode, | |||
2867 | strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); | 2866 | strcpy((void *)xblk, OCFS2_XATTR_BLOCK_SIGNATURE); |
2868 | 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); |
2869 | xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); | 2868 | xblk->xb_suballoc_bit = cpu_to_le16(suballoc_bit_start); |
2870 | xblk->xb_fs_generation = cpu_to_le32(osb->fs_generation); | 2869 | xblk->xb_fs_generation = |
2870 | cpu_to_le32(OCFS2_SB(inode->i_sb)->fs_generation); | ||
2871 | xblk->xb_blkno = cpu_to_le64(first_blkno); | 2871 | xblk->xb_blkno = cpu_to_le64(first_blkno); |
2872 | if (indexed) { | 2872 | if (indexed) { |
2873 | struct ocfs2_xattr_tree_root *xr = &xblk->xb_attrs.xb_root; | 2873 | struct ocfs2_xattr_tree_root *xr = &xblk->xb_attrs.xb_root; |
@@ -4229,7 +4229,6 @@ static int ocfs2_xattr_create_index_block(struct inode *inode, | |||
4229 | u32 bit_off, len; | 4229 | u32 bit_off, len; |
4230 | u64 blkno; | 4230 | u64 blkno; |
4231 | handle_t *handle = ctxt->handle; | 4231 | handle_t *handle = ctxt->handle; |
4232 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
4233 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 4232 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
4234 | struct buffer_head *xb_bh = xs->xattr_bh; | 4233 | struct buffer_head *xb_bh = xs->xattr_bh; |
4235 | struct ocfs2_xattr_block *xb = | 4234 | struct ocfs2_xattr_block *xb = |
@@ -4257,7 +4256,7 @@ static int ocfs2_xattr_create_index_block(struct inode *inode, | |||
4257 | goto out; | 4256 | goto out; |
4258 | } | 4257 | } |
4259 | 4258 | ||
4260 | ret = __ocfs2_claim_clusters(osb, handle, ctxt->data_ac, | 4259 | ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, |
4261 | 1, 1, &bit_off, &len); | 4260 | 1, 1, &bit_off, &len); |
4262 | if (ret) { | 4261 | if (ret) { |
4263 | mlog_errno(ret); | 4262 | mlog_errno(ret); |
@@ -5078,7 +5077,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode, | |||
5078 | goto leave; | 5077 | goto leave; |
5079 | } | 5078 | } |
5080 | 5079 | ||
5081 | ret = __ocfs2_claim_clusters(osb, handle, ctxt->data_ac, 1, | 5080 | ret = __ocfs2_claim_clusters(handle, ctxt->data_ac, 1, |
5082 | clusters_to_add, &bit_off, &num_bits); | 5081 | clusters_to_add, &bit_off, &num_bits); |
5083 | if (ret < 0) { | 5082 | if (ret < 0) { |
5084 | if (ret != -ENOSPC) | 5083 | if (ret != -ENOSPC) |
@@ -6906,7 +6905,7 @@ static int ocfs2_reflink_xattr_rec(struct inode *inode, | |||
6906 | goto out; | 6905 | goto out; |
6907 | } | 6906 | } |
6908 | 6907 | ||
6909 | ret = ocfs2_claim_clusters(osb, handle, data_ac, | 6908 | ret = ocfs2_claim_clusters(handle, data_ac, |
6910 | len, &p_cluster, &num_clusters); | 6909 | len, &p_cluster, &num_clusters); |
6911 | if (ret) { | 6910 | if (ret) { |
6912 | mlog_errno(ret); | 6911 | mlog_errno(ret); |