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

Function space_map_alloc

freebsd/contrib/openzfs/module/zfs/space_map.c:906–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904}
905
906uint64_t
907space_map_alloc(objset_t *os, int blocksize, dmu_tx_t *tx)
908{
909 spa_t *spa = dmu_objset_spa(os);
910 uint64_t object;
911 int bonuslen;
912
913 if (spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) {
914 spa_feature_incr(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM, tx);
915 bonuslen = sizeof (space_map_phys_t);
916 ASSERT3U(bonuslen, <=, dmu_bonus_max());
917 } else {
918 bonuslen = SPACE_MAP_SIZE_V0;
919 }
920
921 object = dmu_object_alloc_ibs(os, DMU_OT_SPACE_MAP, blocksize,
922 space_map_ibs, DMU_OT_SPACE_MAP_HEADER, bonuslen, tx);
923
924 return (object);
925}
926
927void
928space_map_free_obj(objset_t *os, uint64_t smobj, dmu_tx_t *tx)

Callers 5

metaslab_syncFunction · 0.85
vdev_dtl_syncFunction · 0.85
space_map_truncateFunction · 0.85

Calls 5

dmu_objset_spaFunction · 0.85
spa_feature_is_enabledFunction · 0.85
spa_feature_incrFunction · 0.85
dmu_bonus_maxFunction · 0.85
dmu_object_alloc_ibsFunction · 0.85

Tested by

no test coverage detected