gfs2: gfs2_walk_metadata cleanup
Andreas Gruenbacher
maintainerPATCH 1/1 gfs2: gfs2_walk_metadata cleanup
Simplify the code a bit and add an additional assertion.
Signed-off-by Andreas Gruenbacher <[email protected]>
--- fs/gfs2/bmap.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
fs/gfs2/bmap.c +7 -8
@@ -471,7 +471,14 @@ static int gfs2_walk_metadata(struct inode *inode, sector_t lblock,if (step >= len)break ; len -= step; + +if (mp != &clone) { +clone_metapath (&clone, mp); + mp = &clone; + } +if (ptr !=WALK_NEXT ) { +BUG_ON (mp->mp_aheight == mp->mp_fheight);BUG_ON (!*ptr); mp->mp_list[hgt] += ptr - start; goto fill_up_metapath;
@@ -479,10 +486,6 @@ static int gfs2_walk_metadata(struct inode *inode, sector_t lblock, lower_metapath:/* Decrease height of metapath. */ -if (mp != &clone) { -clone_metapath (&clone, mp); - mp = &clone; - }brelse (mp->mp_bh[hgt]); mp->mp_bh[hgt] =NULL ; mp->mp_list[hgt] =0 ;
@@ -503,10 +506,6 @@ static int gfs2_walk_metadata(struct inode *inode, sector_t lblock, fill_up_metapath:/* Increase height of metapath. */ -if (mp != &clone) { -clone_metapath (&clone, mp); - mp = &clone; - } ret =fillup_metapath (ip, mp, ip->i_height -1 );if (ret <0 )break ;
Signature · 1 line
2.20.1
PATCH 1/1 gfs2: gfs2_walk_metadata cleanup
----- Original Message -----
Quoted 4 lines
Simplify the code a bit and add an additional assertion.
Signed-off-by Andreas Gruenbacher <[email protected]>---
Makes sense.
Reviewed-by Bob Peterson <[email protected]>
Bob