| 904 | } |
| 905 | |
| 906 | uint64_t |
| 907 | space_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 | |
| 927 | void |
| 928 | space_map_free_obj(objset_t *os, uint64_t smobj, dmu_tx_t *tx) |
no test coverage detected