diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-02-01 13:16:55 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 10:40:42 +0100 |
commit | 5731be53e3d82aedd06e02574f833a57b07a08d2 (patch) | |
tree | 8877d9c51ac96a3455d8ac5e3148cd7af62d7c98 /fs/gfs2/bmap.c | |
parent | ac576cc5bed0dd7759e2b196468c7df93d6aeeee (diff) | |
download | op-kernel-dev-5731be53e3d82aedd06e02574f833a57b07a08d2.zip op-kernel-dev-5731be53e3d82aedd06e02574f833a57b07a08d2.tar.gz |
[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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 30d718b..651e5320 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) if (isdir) { block = gfs2_alloc_meta(ip); - + gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), block, 1); error = gfs2_dir_get_new_buffer(ip, block, &bh); if (error) goto out_brelse; @@ -206,6 +206,7 @@ static int build_height(struct inode *inode, struct metapath *mp, unsigned heigh for(n = 0; n < new_height; n++) { bn = gfs2_alloc_meta(ip); + gfs2_trans_add_unrevoke(GFS2_SB(inode), bn, 1); mp->mp_bh[n] = gfs2_meta_new(ip->i_gl, bn); gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[n], 1); } @@ -370,8 +371,10 @@ static int lookup_block(struct gfs2_inode *ip, unsigned int height, if (height == ip->i_height - 1 && !gfs2_is_dir(ip)) *block = gfs2_alloc_data(ip); - else + else { *block = gfs2_alloc_meta(ip); + gfs2_trans_add_unrevoke(GFS2_SB(&ip->i_inode), *block, 1); + } gfs2_trans_add_bh(ip->i_gl, mp->mp_bh[height], 1); |