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

Function zap_leaf_chunk_alloc

freebsd/contrib/openzfs/module/zfs/zap_leaf.c:185–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 */
184
185static uint16_t
186zap_leaf_chunk_alloc(zap_leaf_t *l)
187{
188 ASSERT(zap_leaf_phys(l)->l_hdr.lh_nfree > 0);
189
190 int chunk = zap_leaf_phys(l)->l_hdr.lh_freelist;
191 ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(l));
192 ASSERT3U(ZAP_LEAF_CHUNK(l, chunk).l_free.lf_type, ==, ZAP_CHUNK_FREE);
193
194 zap_leaf_phys(l)->l_hdr.lh_freelist =
195 ZAP_LEAF_CHUNK(l, chunk).l_free.lf_next;
196
197 zap_leaf_phys(l)->l_hdr.lh_nfree--;
198
199 return (chunk);
200}
201
202static void
203zap_leaf_chunk_free(zap_leaf_t *l, uint16_t chunk)

Callers 4

zap_leaf_array_createFunction · 0.85
zap_entry_createFunction · 0.85
zap_leaf_transfer_arrayFunction · 0.85
zap_leaf_transfer_entryFunction · 0.85

Calls 1

zap_leaf_physFunction · 0.50

Tested by

no test coverage detected