diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-10-13 23:25:45 +0200 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-10-20 15:13:40 +0200 |
commit | 23591256d61354e20f12e98d7a496ad5c23de74c (patch) | |
tree | 3013a6e873a6e0a1d55fbace2fba638a978108c0 /fs/gfs2/log.c | |
parent | [DLM] fix iovec length in recvmsg (diff) | |
download | linux-23591256d61354e20f12e98d7a496ad5c23de74c.tar.xz linux-23591256d61354e20f12e98d7a496ad5c23de74c.zip |
[GFS2] Fix bmap to map extents properly
This fix means that bmap will map extents of the length requested
by the VFS rather than guessing at it, or just mapping one block
at a time. The other callers of gfs2_block_map are audited to ensure
they send the correct max extent lengths (i.e. set bh->b_size correctly).
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/log.c')
-rw-r--r-- | fs/gfs2/log.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 72eec6542d6a..0cace3da9dbb 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -312,10 +312,12 @@ void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks) static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn) { + struct inode *inode = sdp->sd_jdesc->jd_inode; int error; - struct buffer_head bh_map; + struct buffer_head bh_map = { .b_state = 0, .b_blocknr = 0 }; - error = gfs2_block_map(sdp->sd_jdesc->jd_inode, lbn, 0, &bh_map, 1); + bh_map.b_size = 1 << inode->i_blkbits; + error = gfs2_block_map(inode, lbn, 0, &bh_map); if (error || !bh_map.b_blocknr) printk(KERN_INFO "error=%d, dbn=%llu lbn=%u", error, bh_map.b_blocknr, lbn); gfs2_assert_withdraw(sdp, !error && bh_map.b_blocknr); |