summaryrefslogtreecommitdiff
path: root/fs/gfs2/recovery.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-18 17:18:23 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-18 17:18:23 -0400
commit7a6bbacbb8dec6fbd1242c959250388f907d429e (patch)
tree8e314f0b3fd6e54154562c0a9b20173d539470a2 /fs/gfs2/recovery.c
parent65952fb4e91c159d253bd28ceaf028a86dbb0b02 (diff)
downloadlinux-3.10-7a6bbacbb8dec6fbd1242c959250388f907d429e.tar.gz
linux-3.10-7a6bbacbb8dec6fbd1242c959250388f907d429e.tar.bz2
linux-3.10-7a6bbacbb8dec6fbd1242c959250388f907d429e.zip
[GFS2] Map multiple blocks at once where possible
This is a tidy up of the GFS2 bmap code. The main change is that the bh is passed to gfs2_block_map allowing the flags to be set directly rather than having to repeat that code several times in ops_address.c. At the same time, the extent mapping code from gfs2_extent_map has been moved into gfs2_block_map. This allows all calls to gfs2_block_map to map extents in the case that no allocation is taking place. As a result reads and non-allocating writes should be faster. A quick test with postmark appears to support this. There is a limit on the number of blocks mapped in a single bmap call in that it will only ever map blocks which are pointed to from a single pointer block. So in other words, it will never try to do additional i/o in order to satisfy read-ahead. The maximum number of blocks is thus somewhat less than 512 (the GFS2 4k block size minus the header divided by sizeof(u64)). I've further limited the mapping of "normal" blocks to 32 blocks (to avoid extra work) since readpages() will currently read a maximum of 32 blocks ahead (128k). Some further work will probably be needed to set a suitable value for DIO as well, but for now thats left at the maximum 512 (see ops_address.c:gfs2_get_block_direct). There is probably a lot more that can be done to improve bmap for GFS2, but this is a good first step. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/recovery.c')
-rw-r--r--fs/gfs2/recovery.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index a27569c5d85..130e9fbf969 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -369,25 +369,23 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
unsigned int lblock;
- int new = 0;
- u64 dblock;
struct gfs2_log_header *lh;
u32 hash;
struct buffer_head *bh;
int error;
- int boundary;
+ struct buffer_head bh_map;
lblock = head->lh_blkno;
gfs2_replay_incr_blk(sdp, &lblock);
- error = gfs2_block_map(&ip->i_inode, lblock, &new, &dblock, &boundary);
+ error = gfs2_block_map(&ip->i_inode, lblock, 0, &bh_map, 1);
if (error)
return error;
- if (!dblock) {
+ if (!bh_map.b_blocknr) {
gfs2_consist_inode(ip);
return -EIO;
}
- bh = sb_getblk(sdp->sd_vfs, dblock);
+ bh = sb_getblk(sdp->sd_vfs, bh_map.b_blocknr);
lock_buffer(bh);
memset(bh->b_data, 0, bh->b_size);
set_buffer_uptodate(bh);