MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bpobj_space_range

Function bpobj_space_range

freebsd/contrib/openzfs/module/zfs/bpobj.c:903–928  ·  view source on GitHub ↗

* Return the amount of space in the bpobj which is: * mintxg < blk_birth <= maxtxg */

Source from the content-addressed store, hash-verified

901 * mintxg < blk_birth <= maxtxg
902 */
903int
904bpobj_space_range(bpobj_t *bpo, uint64_t mintxg, uint64_t maxtxg,
905 uint64_t *usedp, uint64_t *compp, uint64_t *uncompp)
906{
907 struct space_range_arg sra = { 0 };
908 int err;
909
910 ASSERT(bpobj_is_open(bpo));
911
912 /*
913 * As an optimization, if they want the whole txg range, just
914 * get bpo_bytes rather than iterating over the bps.
915 */
916 if (mintxg < TXG_INITIAL && maxtxg == UINT64_MAX && bpo->bpo_havecomp)
917 return (bpobj_space(bpo, usedp, compp, uncompp));
918
919 sra.spa = dmu_objset_spa(bpo->bpo_os);
920 sra.mintxg = mintxg;
921 sra.maxtxg = maxtxg;
922
923 err = bpobj_iterate_nofree(bpo, space_range_cb, &sra, NULL);
924 *usedp = sra.used;
925 *compp = sra.comp;
926 *uncompp = sra.uncomp;
927 return (err);
928}
929
930/*
931 * A bpobj_itor_t to append blkptrs to a bplist. Note that while blkptrs in a

Callers 2

bpobj_spaceFunction · 0.85
dsl_deadlist_space_rangeFunction · 0.85

Calls 4

bpobj_is_openFunction · 0.85
bpobj_spaceFunction · 0.85
dmu_objset_spaFunction · 0.85
bpobj_iterate_nofreeFunction · 0.85

Tested by

no test coverage detected