* Return the amount of space in the bpobj which is: * mintxg < blk_birth <= maxtxg */
| 901 | * mintxg < blk_birth <= maxtxg |
| 902 | */ |
| 903 | int |
| 904 | bpobj_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 |
no test coverage detected