diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2020-10-06 15:16:16 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2021-01-18 16:56:37 +0100 |
commit | a12c6fa1de8472f0eb56f7e5a60de2ffa4f6c043 (patch) | |
tree | 6301252710918556202fa3ddd5c483a50834f4ac /fs/gfs2/rgrp.c | |
parent | 2fdc2fa21bc72ec06c0c9f0e30b88fe1f2486b75 (diff) |
gfs2: Don't clear GBF_FULL flags in rs_deltree
Removing a reservation doesn't make any actual space available, so don't clear
the GBF_FULL flags in that case. Otherwise, we'll only spend more time
scanning the bitmaps unnecessarily.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r-- | fs/gfs2/rgrp.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index faf9f21f3e98..f585a13cebde 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -327,20 +327,6 @@ static bool gfs2_rbm_add(struct gfs2_rbm *rbm, u32 blocks) } } -static struct gfs2_bitmap *gfs2_block_to_bitmap(struct gfs2_rgrpd *rgd, - u64 block) -{ - unsigned int delta = (sizeof(struct gfs2_rgrp) - - sizeof(struct gfs2_meta_header)) * GFS2_NBBY; - unsigned int rblock, bii; - - if (!rgrp_contains_block(rgd, block)) - return NULL; - rblock = block - rgd->rd_data0; - bii = (rblock + delta) / rgd->rd_sbd->sd_blocks_per_bitmap; - return rgd->rd_bits + bii; -} - /** * gfs2_unaligned_extlen - Look for free blocks which are not byte aligned * @rbm: Position to search (value/result) @@ -660,25 +646,16 @@ static void __rs_deltree(struct gfs2_blkreserv *rs) RB_CLEAR_NODE(&rs->rs_node); if (rs->rs_free) { - u64 last_block = rs->rs_start + rs->rs_free - 1; - struct gfs2_bitmap *start, *last; - /* return reserved blocks to the rgrp */ BUG_ON(rs->rs_rgd->rd_reserved < rs->rs_free); rs->rs_rgd->rd_reserved -= rs->rs_free; + /* The rgrp extent failure point is likely not to increase; it will only do so if the freed blocks are somehow contiguous with a span of free blocks that follows. Still, it will force the number to be recalculated later. */ rgd->rd_extfail_pt += rs->rs_free; rs->rs_free = 0; - start = gfs2_block_to_bitmap(rgd, rs->rs_start); - last = gfs2_block_to_bitmap(rgd, last_block); - if (!start || !last) - return; - do - clear_bit(GBF_FULL, &start->bi_flags); - while (start++ != last); } } |