diff options
author | Bob Peterson <rpeterso@redhat.com> | 2011-11-18 10:58:32 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-11-21 05:04:09 -0500 |
commit | 6e87ed0fc93ffbe2aec296e6912b1dcb19034d6c (patch) | |
tree | 4f4ac522d34f35de3e3671996ddc35977aaa49ad /fs/gfs2/xattr.c | |
parent | 4442f2e03ed9646664c94e197e637b03324a6664 (diff) |
GFS2: move toward a generic multi-block allocator
This patch is a revision of the one I previously posted.
I tried to integrate all the suggestions Steve gave.
The purpose of the patch is to change function gfs2_alloc_block
(allocate either a dinode block or an extent of data blocks)
to a more generic gfs2_alloc_blocks function that can
allocate both a dinode _and_ an extent of data blocks in the
same call. This will ultimately help us create a multi-block
reservation scheme to reduce file fragmentation.
This patch moves more toward a generic multi-block allocator that
takes a pointer to the number of data blocks to allocate, plus whether
or not to allocate a dinode. In theory, it could be called to allocate
(1) a single dinode block, (2) a group of one or more data blocks, or
(3) a dinode plus several data blocks.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/xattr.c')
-rw-r--r-- | fs/gfs2/xattr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index e4794a5b0a16..ef74e1591b89 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -610,7 +610,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp) | |||
610 | u64 block; | 610 | u64 block; |
611 | int error; | 611 | int error; |
612 | 612 | ||
613 | error = gfs2_alloc_block(ip, &block, &n, 0, NULL); | 613 | error = gfs2_alloc_blocks(ip, &block, &n, 0, NULL); |
614 | if (error) | 614 | if (error) |
615 | return error; | 615 | return error; |
616 | gfs2_trans_add_unrevoke(sdp, block, 1); | 616 | gfs2_trans_add_unrevoke(sdp, block, 1); |
@@ -672,7 +672,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea, | |||
672 | int mh_size = sizeof(struct gfs2_meta_header); | 672 | int mh_size = sizeof(struct gfs2_meta_header); |
673 | unsigned int n = 1; | 673 | unsigned int n = 1; |
674 | 674 | ||
675 | error = gfs2_alloc_block(ip, &block, &n, 0, NULL); | 675 | error = gfs2_alloc_blocks(ip, &block, &n, 0, NULL); |
676 | if (error) | 676 | if (error) |
677 | return error; | 677 | return error; |
678 | gfs2_trans_add_unrevoke(sdp, block, 1); | 678 | gfs2_trans_add_unrevoke(sdp, block, 1); |
@@ -992,7 +992,7 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er, | |||
992 | } else { | 992 | } else { |
993 | u64 blk; | 993 | u64 blk; |
994 | unsigned int n = 1; | 994 | unsigned int n = 1; |
995 | error = gfs2_alloc_block(ip, &blk, &n, 0, NULL); | 995 | error = gfs2_alloc_blocks(ip, &blk, &n, 0, NULL); |
996 | if (error) | 996 | if (error) |
997 | return error; | 997 | return error; |
998 | gfs2_trans_add_unrevoke(sdp, blk, 1); | 998 | gfs2_trans_add_unrevoke(sdp, blk, 1); |