diff options
author | Bob Peterson <rpeterso@redhat.com> | 2011-11-14 11:17:08 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-11-15 10:25:03 -0500 |
commit | 3c5d785acfda7dffa63477951bb6864c6a49ed2e (patch) | |
tree | aa387498361ad753777363322a35b8feb80e5f85 /fs/gfs2/xattr.c | |
parent | c688b8b334d20acbc79b0383af2816ecf7365741 (diff) |
GFS2: combine gfs2_alloc_block and gfs2_alloc_di
GFS2 functions gfs2_alloc_block and gfs2_alloc_di do basically
the same things, with a few exceptions. This patch combines
the two functions into a slightly more generic gfs2_alloc_block.
Having one centralized block allocation function will reduce
code redundancy and make it easier to implement multi-block
reservations to reduce file fragmentation in the future.
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 a201a1d57a6d..e4794a5b0a16 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); | 613 | error = gfs2_alloc_block(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); | 675 | error = gfs2_alloc_block(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); | 995 | error = gfs2_alloc_block(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); |