diff options
author | Joel Becker <joel.becker@oracle.com> | 2009-02-13 06:34:15 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-04 19:08:09 -0400 |
commit | cbee7e1a6a1a2a3d6eda1f76ffc38a3ed3eeb6cc (patch) | |
tree | 438ac4917675c27ecd3dce694ae3affd7ebf6c91 /fs | |
parent | cc79d8c19e9d39446525a1026f1a21761f5d3cd2 (diff) |
ocfs2: ocfs2_add_clusters_in_btree() no longer needs struct inode.
One more function that doesn't need a struct inode to pass to its
children.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/alloc.c | 13 | ||||
-rw-r--r-- | fs/ocfs2/alloc.h | 6 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 7 | ||||
-rw-r--r-- | fs/ocfs2/xattr.c | 7 |
4 files changed, 14 insertions, 19 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index c4943b91c7a4..29095e155949 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -4758,13 +4758,11 @@ bail: | |||
4758 | * it is not limited to the file storage. Any extent tree can use this | 4758 | * it is not limited to the file storage. Any extent tree can use this |
4759 | * function if it implements the proper ocfs2_extent_tree. | 4759 | * function if it implements the proper ocfs2_extent_tree. |
4760 | */ | 4760 | */ |
4761 | int ocfs2_add_clusters_in_btree(struct ocfs2_super *osb, | 4761 | int ocfs2_add_clusters_in_btree(handle_t *handle, |
4762 | struct inode *inode, | 4762 | struct ocfs2_extent_tree *et, |
4763 | u32 *logical_offset, | 4763 | u32 *logical_offset, |
4764 | u32 clusters_to_add, | 4764 | u32 clusters_to_add, |
4765 | int mark_unwritten, | 4765 | int mark_unwritten, |
4766 | struct ocfs2_extent_tree *et, | ||
4767 | handle_t *handle, | ||
4768 | struct ocfs2_alloc_context *data_ac, | 4766 | struct ocfs2_alloc_context *data_ac, |
4769 | struct ocfs2_alloc_context *meta_ac, | 4767 | struct ocfs2_alloc_context *meta_ac, |
4770 | enum ocfs2_alloc_restarted *reason_ret) | 4768 | enum ocfs2_alloc_restarted *reason_ret) |
@@ -4775,6 +4773,8 @@ int ocfs2_add_clusters_in_btree(struct ocfs2_super *osb, | |||
4775 | u32 bit_off, num_bits; | 4773 | u32 bit_off, num_bits; |
4776 | u64 block; | 4774 | u64 block; |
4777 | u8 flags = 0; | 4775 | u8 flags = 0; |
4776 | struct ocfs2_super *osb = | ||
4777 | OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci)); | ||
4778 | 4778 | ||
4779 | BUG_ON(!clusters_to_add); | 4779 | BUG_ON(!clusters_to_add); |
4780 | 4780 | ||
@@ -4826,8 +4826,9 @@ int ocfs2_add_clusters_in_btree(struct ocfs2_super *osb, | |||
4826 | } | 4826 | } |
4827 | 4827 | ||
4828 | block = ocfs2_clusters_to_blocks(osb->sb, bit_off); | 4828 | block = ocfs2_clusters_to_blocks(osb->sb, bit_off); |
4829 | mlog(0, "Allocating %u clusters at block %u for inode %llu\n", | 4829 | mlog(0, "Allocating %u clusters at block %u for owner %llu\n", |
4830 | num_bits, bit_off, (unsigned long long)OCFS2_I(inode)->ip_blkno); | 4830 | num_bits, bit_off, |
4831 | (unsigned long long)ocfs2_metadata_cache_owner(et->et_ci)); | ||
4831 | status = ocfs2_insert_extent(handle, et, *logical_offset, block, | 4832 | status = ocfs2_insert_extent(handle, et, *logical_offset, block, |
4832 | num_bits, flags, meta_ac); | 4833 | num_bits, flags, meta_ac); |
4833 | if (status < 0) { | 4834 | if (status < 0) { |
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h index 99accd30af0e..d1d196eada8f 100644 --- a/fs/ocfs2/alloc.h +++ b/fs/ocfs2/alloc.h | |||
@@ -103,13 +103,11 @@ enum ocfs2_alloc_restarted { | |||
103 | RESTART_TRANS, | 103 | RESTART_TRANS, |
104 | RESTART_META | 104 | RESTART_META |
105 | }; | 105 | }; |
106 | int ocfs2_add_clusters_in_btree(struct ocfs2_super *osb, | 106 | int ocfs2_add_clusters_in_btree(handle_t *handle, |
107 | struct inode *inode, | 107 | struct ocfs2_extent_tree *et, |
108 | u32 *logical_offset, | 108 | u32 *logical_offset, |
109 | u32 clusters_to_add, | 109 | u32 clusters_to_add, |
110 | int mark_unwritten, | 110 | int mark_unwritten, |
111 | struct ocfs2_extent_tree *et, | ||
112 | handle_t *handle, | ||
113 | struct ocfs2_alloc_context *data_ac, | 111 | struct ocfs2_alloc_context *data_ac, |
114 | struct ocfs2_alloc_context *meta_ac, | 112 | struct ocfs2_alloc_context *meta_ac, |
115 | enum ocfs2_alloc_restarted *reason_ret); | 113 | enum ocfs2_alloc_restarted *reason_ret); |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 3ddbc5e917e2..891e2c1e625c 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -516,10 +516,9 @@ int ocfs2_add_inode_data(struct ocfs2_super *osb, | |||
516 | struct ocfs2_extent_tree et; | 516 | struct ocfs2_extent_tree et; |
517 | 517 | ||
518 | ocfs2_init_dinode_extent_tree(&et, inode, fe_bh); | 518 | ocfs2_init_dinode_extent_tree(&et, inode, fe_bh); |
519 | ret = ocfs2_add_clusters_in_btree(osb, inode, logical_offset, | 519 | ret = ocfs2_add_clusters_in_btree(handle, &et, logical_offset, |
520 | clusters_to_add, mark_unwritten, | 520 | clusters_to_add, mark_unwritten, |
521 | &et, handle, | 521 | data_ac, meta_ac, reason_ret); |
522 | data_ac, meta_ac, reason_ret); | ||
523 | 522 | ||
524 | return ret; | 523 | return ret; |
525 | } | 524 | } |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 38db12ab848f..fdd02c43fa14 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -597,7 +597,6 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
597 | int status = 0; | 597 | int status = 0; |
598 | handle_t *handle = ctxt->handle; | 598 | handle_t *handle = ctxt->handle; |
599 | enum ocfs2_alloc_restarted why; | 599 | enum ocfs2_alloc_restarted why; |
600 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
601 | u32 prev_clusters, logical_start = le32_to_cpu(vb->vb_xv->xr_clusters); | 600 | u32 prev_clusters, logical_start = le32_to_cpu(vb->vb_xv->xr_clusters); |
602 | struct ocfs2_extent_tree et; | 601 | struct ocfs2_extent_tree et; |
603 | 602 | ||
@@ -613,13 +612,11 @@ static int ocfs2_xattr_extend_allocation(struct inode *inode, | |||
613 | } | 612 | } |
614 | 613 | ||
615 | prev_clusters = le32_to_cpu(vb->vb_xv->xr_clusters); | 614 | prev_clusters = le32_to_cpu(vb->vb_xv->xr_clusters); |
616 | status = ocfs2_add_clusters_in_btree(osb, | 615 | status = ocfs2_add_clusters_in_btree(handle, |
617 | inode, | 616 | &et, |
618 | &logical_start, | 617 | &logical_start, |
619 | clusters_to_add, | 618 | clusters_to_add, |
620 | 0, | 619 | 0, |
621 | &et, | ||
622 | handle, | ||
623 | ctxt->data_ac, | 620 | ctxt->data_ac, |
624 | ctxt->meta_ac, | 621 | ctxt->meta_ac, |
625 | &why); | 622 | &why); |