aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ocfs2/alloc.c19
-rw-r--r--fs/ocfs2/alloc.h4
-rw-r--r--fs/ocfs2/dir.c12
-rw-r--r--fs/ocfs2/xattr.c2
4 files changed, 15 insertions, 22 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index ed869889c4fb..c4943b91c7a4 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -4681,13 +4681,11 @@ out:
4681} 4681}
4682 4682
4683/* 4683/*
4684 * Insert an extent into an inode btree. 4684 * Insert an extent into a btree.
4685 * 4685 *
4686 * The caller needs to update fe->i_clusters 4686 * The caller needs to update the owning btree's cluster count.
4687 */ 4687 */
4688int ocfs2_insert_extent(struct ocfs2_super *osb, 4688int ocfs2_insert_extent(handle_t *handle,
4689 handle_t *handle,
4690 struct inode *inode,
4691 struct ocfs2_extent_tree *et, 4689 struct ocfs2_extent_tree *et,
4692 u32 cpos, 4690 u32 cpos,
4693 u64 start_blk, 4691 u64 start_blk,
@@ -4701,8 +4699,9 @@ int ocfs2_insert_extent(struct ocfs2_super *osb,
4701 struct ocfs2_insert_type insert = {0, }; 4699 struct ocfs2_insert_type insert = {0, };
4702 struct ocfs2_extent_rec rec; 4700 struct ocfs2_extent_rec rec;
4703 4701
4704 mlog(0, "add %u clusters at position %u to inode %llu\n", 4702 mlog(0, "add %u clusters at position %u to owner %llu\n",
4705 new_clusters, cpos, (unsigned long long)OCFS2_I(inode)->ip_blkno); 4703 new_clusters, cpos,
4704 (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci));
4706 4705
4707 memset(&rec, 0, sizeof(rec)); 4706 memset(&rec, 0, sizeof(rec));
4708 rec.e_cpos = cpu_to_le32(cpos); 4707 rec.e_cpos = cpu_to_le32(cpos);
@@ -4829,8 +4828,7 @@ int ocfs2_add_clusters_in_btree(struct ocfs2_super *osb,
4829 block = ocfs2_clusters_to_blocks(osb->sb, bit_off); 4828 block = ocfs2_clusters_to_blocks(osb->sb, bit_off);
4830 mlog(0, "Allocating %u clusters at block %u for inode %llu\n", 4829 mlog(0, "Allocating %u clusters at block %u for inode %llu\n",
4831 num_bits, bit_off, (unsigned long long)OCFS2_I(inode)->ip_blkno); 4830 num_bits, bit_off, (unsigned long long)OCFS2_I(inode)->ip_blkno);
4832 status = ocfs2_insert_extent(osb, handle, inode, et, 4831 status = ocfs2_insert_extent(handle, et, *logical_offset, block,
4833 *logical_offset, block,
4834 num_bits, flags, meta_ac); 4832 num_bits, flags, meta_ac);
4835 if (status < 0) { 4833 if (status < 0) {
4836 mlog_errno(status); 4834 mlog_errno(status);
@@ -7244,8 +7242,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode,
7244 * the in-inode data from our pages. 7242 * the in-inode data from our pages.
7245 */ 7243 */
7246 ocfs2_init_dinode_extent_tree(&et, inode, di_bh); 7244 ocfs2_init_dinode_extent_tree(&et, inode, di_bh);
7247 ret = ocfs2_insert_extent(osb, handle, inode, &et, 7245 ret = ocfs2_insert_extent(handle, &et, 0, block, 1, 0, NULL);
7248 0, block, 1, 0, NULL);
7249 if (ret) { 7246 if (ret) {
7250 mlog_errno(ret); 7247 mlog_errno(ret);
7251 goto out_commit; 7248 goto out_commit;
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h
index 8718e57e70a1..99accd30af0e 100644
--- a/fs/ocfs2/alloc.h
+++ b/fs/ocfs2/alloc.h
@@ -90,9 +90,7 @@ int ocfs2_read_extent_block(struct ocfs2_caching_info *ci, u64 eb_blkno,
90 struct buffer_head **bh); 90 struct buffer_head **bh);
91 91
92struct ocfs2_alloc_context; 92struct ocfs2_alloc_context;
93int ocfs2_insert_extent(struct ocfs2_super *osb, 93int ocfs2_insert_extent(handle_t *handle,
94 handle_t *handle,
95 struct inode *inode,
96 struct ocfs2_extent_tree *et, 94 struct ocfs2_extent_tree *et,
97 u32 cpos, 95 u32 cpos,
98 u64 start_blk, 96 u64 start_blk,
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 088a1b5ce9ac..de490a6d76ba 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -2591,7 +2591,6 @@ static int ocfs2_dx_dir_new_cluster(struct inode *dir,
2591{ 2591{
2592 int ret; 2592 int ret;
2593 u64 phys_blkno; 2593 u64 phys_blkno;
2594 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
2595 2594
2596 ret = __ocfs2_dx_dir_new_cluster(dir, cpos, handle, data_ac, dx_leaves, 2595 ret = __ocfs2_dx_dir_new_cluster(dir, cpos, handle, data_ac, dx_leaves,
2597 num_dx_leaves, &phys_blkno); 2596 num_dx_leaves, &phys_blkno);
@@ -2600,7 +2599,7 @@ static int ocfs2_dx_dir_new_cluster(struct inode *dir,
2600 goto out; 2599 goto out;
2601 } 2600 }
2602 2601
2603 ret = ocfs2_insert_extent(osb, handle, dir, et, cpos, phys_blkno, 1, 0, 2602 ret = ocfs2_insert_extent(handle, et, cpos, phys_blkno, 1, 0,
2604 meta_ac); 2603 meta_ac);
2605 if (ret) 2604 if (ret)
2606 mlog_errno(ret); 2605 mlog_errno(ret);
@@ -3094,7 +3093,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
3094 * This should never fail as our extent list is empty and all 3093 * This should never fail as our extent list is empty and all
3095 * related blocks have been journaled already. 3094 * related blocks have been journaled already.
3096 */ 3095 */
3097 ret = ocfs2_insert_extent(osb, handle, dir, &et, 0, blkno, len, 3096 ret = ocfs2_insert_extent(handle, &et, 0, blkno, len,
3098 0, NULL); 3097 0, NULL);
3099 if (ret) { 3098 if (ret) {
3100 mlog_errno(ret); 3099 mlog_errno(ret);
@@ -3127,7 +3126,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
3127 dirdata_bh); 3126 dirdata_bh);
3128 } else { 3127 } else {
3129 ocfs2_init_dx_root_extent_tree(&dx_et, dir, dx_root_bh); 3128 ocfs2_init_dx_root_extent_tree(&dx_et, dir, dx_root_bh);
3130 ret = ocfs2_insert_extent(osb, handle, dir, &dx_et, 0, 3129 ret = ocfs2_insert_extent(handle, &dx_et, 0,
3131 dx_insert_blkno, 1, 0, NULL); 3130 dx_insert_blkno, 1, 0, NULL);
3132 if (ret) 3131 if (ret)
3133 mlog_errno(ret); 3132 mlog_errno(ret);
@@ -3147,7 +3146,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
3147 } 3146 }
3148 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off); 3147 blkno = ocfs2_clusters_to_blocks(dir->i_sb, bit_off);
3149 3148
3150 ret = ocfs2_insert_extent(osb, handle, dir, &et, 1, 3149 ret = ocfs2_insert_extent(handle, &et, 1,
3151 blkno, len, 0, NULL); 3150 blkno, len, 0, NULL);
3152 if (ret) { 3151 if (ret) {
3153 mlog_errno(ret); 3152 mlog_errno(ret);
@@ -4218,8 +4217,7 @@ static int ocfs2_expand_inline_dx_root(struct inode *dir,
4218 /* This should never fail considering we start with an empty 4217 /* This should never fail considering we start with an empty
4219 * dx_root. */ 4218 * dx_root. */
4220 ocfs2_init_dx_root_extent_tree(&et, dir, dx_root_bh); 4219 ocfs2_init_dx_root_extent_tree(&et, dir, dx_root_bh);
4221 ret = ocfs2_insert_extent(osb, handle, dir, &et, 0, 4220 ret = ocfs2_insert_extent(handle, &et, 0, insert_blkno, 1, 0, NULL);
4222 insert_blkno, 1, 0, NULL);
4223 if (ret) 4221 if (ret)
4224 mlog_errno(ret); 4222 mlog_errno(ret);
4225 did_quota = 0; 4223 did_quota = 0;
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 61819b208315..38db12ab848f 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -4325,7 +4325,7 @@ static int ocfs2_add_new_xattr_cluster(struct inode *inode,
4325 4325
4326 mlog(0, "Insert %u clusters at block %llu for xattr at %u\n", 4326 mlog(0, "Insert %u clusters at block %llu for xattr at %u\n",
4327 num_bits, (unsigned long long)block, v_start); 4327 num_bits, (unsigned long long)block, v_start);
4328 ret = ocfs2_insert_extent(osb, handle, inode, &et, v_start, block, 4328 ret = ocfs2_insert_extent(handle, &et, v_start, block,
4329 num_bits, 0, ctxt->meta_ac); 4329 num_bits, 0, ctxt->meta_ac);
4330 if (ret < 0) { 4330 if (ret < 0) {
4331 mlog_errno(ret); 4331 mlog_errno(ret);