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

Function bpobj_alloc_empty

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

* Return an empty bpobj, preferably the empty dummy one (dp_empty_bpobj). */

Source from the content-addressed store, hash-verified

35 * Return an empty bpobj, preferably the empty dummy one (dp_empty_bpobj).
36 */
37uint64_t
38bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx)
39{
40 spa_t *spa = dmu_objset_spa(os);
41 dsl_pool_t *dp = dmu_objset_pool(os);
42
43 if (spa_feature_is_enabled(spa, SPA_FEATURE_EMPTY_BPOBJ)) {
44 if (!spa_feature_is_active(spa, SPA_FEATURE_EMPTY_BPOBJ)) {
45 ASSERT0(dp->dp_empty_bpobj);
46 dp->dp_empty_bpobj =
47 bpobj_alloc(os, SPA_OLD_MAXBLOCKSIZE, tx);
48 VERIFY(zap_add(os,
49 DMU_POOL_DIRECTORY_OBJECT,
50 DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1,
51 &dp->dp_empty_bpobj, tx) == 0);
52 }
53 spa_feature_incr(spa, SPA_FEATURE_EMPTY_BPOBJ, tx);
54 ASSERT(dp->dp_empty_bpobj != 0);
55 return (dp->dp_empty_bpobj);
56 } else {
57 return (bpobj_alloc(os, blocksize, tx));
58 }
59}
60
61void
62bpobj_decr_empty(objset_t *os, dmu_tx_t *tx)

Callers 3

dsl_deadlist_add_keyFunction · 0.85
dsl_deadlist_clear_entryFunction · 0.85
dsl_deadlist_cloneFunction · 0.85

Calls 7

dmu_objset_spaFunction · 0.85
dmu_objset_poolFunction · 0.85
spa_feature_is_enabledFunction · 0.85
spa_feature_is_activeFunction · 0.85
bpobj_allocFunction · 0.85
zap_addFunction · 0.85
spa_feature_incrFunction · 0.85

Tested by

no test coverage detected