aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-02-01 08:16:55 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 05:40:42 -0400
commit5731be53e3d82aedd06e02574f833a57b07a08d2 (patch)
tree8877d9c51ac96a3455d8ac5e3148cd7af62d7c98 /fs/gfs2/bmap.c
parentac576cc5bed0dd7759e2b196468c7df93d6aeeee (diff)
[GFS2] Update gfs2_trans_add_unrevoke to accept extents
By adding an extra argument to gfs2_trans_add_unrevoke we can now specify an extent length of blocks to unrevoke. This means that we only need to make one pass through the list for each extent rather than each block. Currently the only extent length which is used is 1, but that will change in the future. Also gfs2_trans_add_unrevoke is removed from gfs2_alloc_meta since its the only difference between this and gfs2_alloc_data which is left. This will allow a future patch to merge these two functions into one (i.e. one call to allocate both data and metadata in a single extent in the future). Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 30d718b3438f..651e5320bb4f 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -138,7 +138,7 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page)
138 138
139 if (isdir) { 139 if (isdir) {
140 block = gfs2_alloc_meta(ip); 140 block = gfs2_alloc_meta(ip);
141 141 gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1);
142 error = gfs2_dir_get_new_buffer(ip, block, &bh); 142 error = gfs2_dir_get_new_buffer(ip, block, &bh);
143 if (error) 143 if (error)
144 goto out_brelse; 144 goto out_brelse;
@@ -206,6 +206,7 @@ static int build_height(struct inode *inode, struct metapath *mp, unsigned heigh
206 206
207 for(n = 0; n < new_height; n++) { 207 for(n = 0; n < new_height; n++) {
208 bn = gfs2_alloc_meta(ip); 208 bn = gfs2_alloc_meta(ip);
209 gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1);
209 mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn); 210 mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn);
210 gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1); 211 gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1);
211 } 212 }
@@ -370,8 +371,10 @@ static int lookup_block(struct gfs2_inode *ip, unsigned int height,
370 371
371 if (height == ip->i_height - 1 && !gfs2_is_dir(ip)) 372 if (height == ip->i_height - 1 && !gfs2_is_dir(ip))
372 *block = gfs2_alloc_data(ip); 373 *block = gfs2_alloc_data(ip);
373 else 374 else {
374 *block = gfs2_alloc_meta(ip); 375 *block = gfs2_alloc_meta(ip);
376 gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), *block, 1);
377 }
375 378
376 gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); 379 gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1);
377 380