| 200 | } |
| 201 | |
| 202 | static void |
| 203 | zap_leaf_chunk_free(zap_leaf_t *l, uint16_t chunk) |
| 204 | { |
| 205 | struct zap_leaf_free *zlf = &ZAP_LEAF_CHUNK(l, chunk).l_free; |
| 206 | ASSERT3U(zap_leaf_phys(l)->l_hdr.lh_nfree, <, ZAP_LEAF_NUMCHUNKS(l)); |
| 207 | ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l)); |
| 208 | ASSERT(zlf->lf_type != ZAP_CHUNK_FREE); |
| 209 | |
| 210 | zlf->lf_type = ZAP_CHUNK_FREE; |
| 211 | zlf->lf_next = zap_leaf_phys(l)->l_hdr.lh_freelist; |
| 212 | bzero(zlf->lf_pad, sizeof (zlf->lf_pad)); /* help it to compress */ |
| 213 | zap_leaf_phys(l)->l_hdr.lh_freelist = chunk; |
| 214 | |
| 215 | zap_leaf_phys(l)->l_hdr.lh_nfree++; |
| 216 | } |
| 217 | |
| 218 | /* |
| 219 | * Routines which manipulate leaf arrays (zap_leaf_array type chunks). |
no test coverage detected