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

Function zap_leaf_transfer_entry

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

Source from the content-addressed store, hash-verified

740}
741
742static void
743zap_leaf_transfer_entry(zap_leaf_t *l, int entry, zap_leaf_t *nl)
744{
745 struct zap_leaf_entry *le = ZAP_LEAF_ENTRY(l, entry);
746 ASSERT3U(le->le_type, ==, ZAP_CHUNK_ENTRY);
747
748 uint16_t chunk = zap_leaf_chunk_alloc(nl);
749 struct zap_leaf_entry *nle = ZAP_LEAF_ENTRY(nl, chunk);
750 *nle = *le; /* structure assignment */
751
752 (void) zap_leaf_rehash_entry(nl, chunk);
753
754 nle->le_name_chunk = zap_leaf_transfer_array(l, le->le_name_chunk, nl);
755 nle->le_value_chunk =
756 zap_leaf_transfer_array(l, le->le_value_chunk, nl);
757
758 zap_leaf_chunk_free(l, entry);
759
760 zap_leaf_phys(l)->l_hdr.lh_nentries--;
761 zap_leaf_phys(nl)->l_hdr.lh_nentries++;
762}
763
764/*
765 * Transfer the entries whose hash prefix ends in 1 to the new leaf.

Callers 1

zap_leaf_splitFunction · 0.85

Calls 5

zap_leaf_chunk_allocFunction · 0.85
zap_leaf_rehash_entryFunction · 0.85
zap_leaf_transfer_arrayFunction · 0.85
zap_leaf_chunk_freeFunction · 0.85
zap_leaf_physFunction · 0.50

Tested by

no test coverage detected