aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-02-06 05:11:15 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 05:40:47 -0400
commitb45e41d7d56dfef1ae9e02e6c59990066ba82e5c (patch)
treec139447fa57beb3886def4e17449cc34bf40cf3c /fs/gfs2/eattr.c
parent1639431a3f57b43da1e15e9268a1d691ac01ba26 (diff)
[GFS2] Add extent allocation to block allocator
Rather than having to allocate a single block at a time, this patch allows the block allocator to allocate an extent. Since there is no difference (so far as the block allocator is concerned) between data blocks and indirect blocks, it is posible to allocate a single extent and for the caller to unrevoke just the blocks required for indirect blocks. Currently the only bit of GFS2 to make use of this feature is the build height function. The intention is that gfs2_block_map will be changed to make use of this feature in future patches. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/eattr.c')
-rw-r--r--fs/gfs2/eattr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index f9f63bc21cd2..0e79cd543496 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -582,9 +582,10 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp)
582{ 582{
583 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 583 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
584 struct gfs2_ea_header *ea; 584 struct gfs2_ea_header *ea;
585 unsigned int n = 1;
585 u64 block; 586 u64 block;
586 587
587 block = gfs2_alloc_block(ip); 588 block = gfs2_alloc_block(ip, &n);
588 gfs2_trans_add_unrevoke(sdp, block, 1); 589 gfs2_trans_add_unrevoke(sdp, block, 1);
589 *bhp = gfs2_meta_new(ip->i_gl, block); 590 *bhp = gfs2_meta_new(ip->i_gl, block);
590 gfs2_trans_add_bh(ip->i_gl, *bhp, 1); 591 gfs2_trans_add_bh(ip->i_gl, *bhp, 1);
@@ -642,8 +643,9 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
642 struct buffer_head *bh; 643 struct buffer_head *bh;
643 u64 block; 644 u64 block;
644 int mh_size = sizeof(struct gfs2_meta_header); 645 int mh_size = sizeof(struct gfs2_meta_header);
646 unsigned int n = 1;
645 647
646 block = gfs2_alloc_block(ip); 648 block = gfs2_alloc_block(ip, &n);
647 gfs2_trans_add_unrevoke(sdp, block, 1); 649 gfs2_trans_add_unrevoke(sdp, block, 1);
648 bh = gfs2_meta_new(ip->i_gl, block); 650 bh = gfs2_meta_new(ip->i_gl, block);
649 gfs2_trans_add_bh(ip->i_gl, bh, 1); 651 gfs2_trans_add_bh(ip->i_gl, bh, 1);
@@ -966,8 +968,8 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
966 gfs2_trans_add_bh(ip->i_gl, indbh, 1); 968 gfs2_trans_add_bh(ip->i_gl, indbh, 1);
967 } else { 969 } else {
968 u64 blk; 970 u64 blk;
969 971 unsigned int n = 1;
970 blk = gfs2_alloc_block(ip); 972 blk = gfs2_alloc_block(ip, &n);
971 gfs2_trans_add_unrevoke(sdp, blk, 1); 973 gfs2_trans_add_unrevoke(sdp, blk, 1);
972 indbh = gfs2_meta_new(ip->i_gl, blk); 974 indbh = gfs2_meta_new(ip->i_gl, blk);
973 gfs2_trans_add_bh(ip->i_gl, indbh, 1); 975 gfs2_trans_add_bh(ip->i_gl, indbh, 1);