Skip to content

Commit 1c7ce11

Browse files
author
Darrick J. Wong
committed
xfs: reap large AG metadata extents when possible
When we're freeing extents that have been set in a bitmap, break the bitmap extent into multiple sub-extents organized by fate, and reap the extents. This enables us to dispose of old resources more efficiently than doing them block by block. While we're at it, rename the reaping functions to make it clear that they're reaping per-AG extents. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
1 parent 9ed851f commit 1c7ce11

File tree

8 files changed

+409
-121
lines changed

8 files changed

+409
-121
lines changed

fs/xfs/scrub/agheader_repair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ xrep_agfl(
775775
goto err;
776776

777777
/* Dump any AGFL overflow. */
778-
error = xrep_reap_extents(sc, &agfl_extents, &XFS_RMAP_OINFO_AG,
778+
error = xrep_reap_ag_metadata(sc, &agfl_extents, &XFS_RMAP_OINFO_AG,
779779
XFS_AG_RESV_AGFL);
780780
err:
781781
xbitmap_destroy(&agfl_extents);

fs/xfs/scrub/bitmap.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -385,43 +385,6 @@ xbitmap_walk(
385385
return error;
386386
}
387387

388-
struct xbitmap_walk_bits {
389-
xbitmap_walk_bits_fn fn;
390-
void *priv;
391-
};
392-
393-
/* Walk all the bits in a run. */
394-
static int
395-
xbitmap_walk_bits_in_run(
396-
uint64_t start,
397-
uint64_t len,
398-
void *priv)
399-
{
400-
struct xbitmap_walk_bits *wb = priv;
401-
uint64_t i;
402-
int error = 0;
403-
404-
for (i = start; i < start + len; i++) {
405-
error = wb->fn(i, wb->priv);
406-
if (error)
407-
break;
408-
}
409-
410-
return error;
411-
}
412-
413-
/* Call a function for every set bit in this bitmap. */
414-
int
415-
xbitmap_walk_bits(
416-
struct xbitmap *bitmap,
417-
xbitmap_walk_bits_fn fn,
418-
void *priv)
419-
{
420-
struct xbitmap_walk_bits wb = {.fn = fn, .priv = priv};
421-
422-
return xbitmap_walk(bitmap, xbitmap_walk_bits_in_run, &wb);
423-
}
424-
425388
/* Does this bitmap have no bits set at all? */
426389
bool
427390
xbitmap_empty(

fs/xfs/scrub/bitmap.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ typedef int (*xbitmap_walk_fn)(uint64_t start, uint64_t len, void *priv);
3333
int xbitmap_walk(struct xbitmap *bitmap, xbitmap_walk_fn fn,
3434
void *priv);
3535

36-
typedef int (*xbitmap_walk_bits_fn)(uint64_t bit, void *priv);
37-
int xbitmap_walk_bits(struct xbitmap *bitmap, xbitmap_walk_bits_fn fn,
38-
void *priv);
39-
4036
bool xbitmap_empty(struct xbitmap *bitmap);
4137
bool xbitmap_test(struct xbitmap *bitmap, uint64_t start, uint64_t *len);
4238

0 commit comments

Comments
 (0)