diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2014-03-03 13:35:57 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2014-03-03 13:50:12 +0000 |
commit | b50f227bddf110ae4ea2df1ebdf7e282ad481803 (patch) | |
tree | e3c968ae81f8ac2c2c425b13543728a32b359d2f /fs/gfs2/lops.c | |
parent | fcf10d38afd2d39d08bf76c48ff9c12345770678 (diff) | |
download | op-kernel-dev-b50f227bddf110ae4ea2df1ebdf7e282ad481803.zip op-kernel-dev-b50f227bddf110ae4ea2df1ebdf7e282ad481803.tar.gz |
GFS2: Clean up journal extent mapping
This patch fixes a long standing issue in mapping the journal
extents. Most journals will consist of only a single extent,
and although the cache took account of that by merging extents,
it did not actually map large extents, but instead was doing a
block by block mapping. Since the journal was only being mapped
on mount, this was not normally noticeable.
With the updated code, it is now possible to use the same extent
mapping system during journal recovery (which will be added in a
later patch). This will allow checking of the integrity of the
journal before any reply of the journal content is attempted. For
this reason the code is moving to bmap.c, since it will be used
more widely in due course.
An exercise left for the reader is to compare the new function
gfs2_map_journal_extents() with gfs2_write_alloc_required()
Additionally, should there be a failure, the error reporting is
also updated to show more detail about what went wrong.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r-- | fs/gfs2/lops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 23c6e72..ae1d635 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -146,8 +146,8 @@ static u64 gfs2_log_bmap(struct gfs2_sbd *sdp) struct gfs2_journal_extent *je; u64 block; - list_for_each_entry(je, &sdp->sd_jdesc->extent_list, extent_list) { - if (lbn >= je->lblock && lbn < je->lblock + je->blocks) { + list_for_each_entry(je, &sdp->sd_jdesc->extent_list, list) { + if ((lbn >= je->lblock) && (lbn < (je->lblock + je->blocks))) { block = je->dblock + lbn - je->lblock; gfs2_log_incr_head(sdp); return block; |