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

Function mzap_create_impl

freebsd/contrib/openzfs/module/zfs/zap_micro.c:700–724  ·  view source on GitHub ↗

* The "normflags" determine the behavior of the matchtype_t which is * passed to zap_lookup_norm(). Names which have the same normalized * version will be stored with the same hash value, and therefore we can * perform normalization-insensitive lookups. We can be Unicode form- * insensitive and/or case-insensitive. The following flags are valid for * "normflags": * * U8_TEXTPREP_NFC * U

Source from the content-addressed store, hash-verified

698 * of them may be supplied.
699 */
700void
701mzap_create_impl(dnode_t *dn, int normflags, zap_flags_t flags, dmu_tx_t *tx)
702{
703 dmu_buf_t *db;
704
705 VERIFY0(dmu_buf_hold_by_dnode(dn, 0, FTAG, &db, DMU_READ_NO_PREFETCH));
706
707 dmu_buf_will_dirty(db, tx);
708 mzap_phys_t *zp = db->db_data;
709 zp->mz_block_type = ZBT_MICRO;
710 zp->mz_salt =
711 ((uintptr_t)db ^ (uintptr_t)tx ^ (dn->dn_object << 1)) | 1ULL;
712 zp->mz_normflags = normflags;
713
714 if (flags != 0) {
715 zap_t *zap;
716 /* Only fat zap supports flags; upgrade immediately. */
717 VERIFY0(zap_lockdir_impl(db, FTAG, tx, RW_WRITER,
718 B_FALSE, B_FALSE, &zap));
719 VERIFY0(mzap_upgrade(&zap, FTAG, tx, flags));
720 zap_unlockdir(zap, FTAG);
721 } else {
722 dmu_buf_rele(db, FTAG);
723 }
724}
725
726static uint64_t
727zap_create_impl(objset_t *os, int normflags, zap_flags_t flags,

Callers 3

dmu_object_zapifyFunction · 0.85
zap_create_implFunction · 0.85

Calls 6

dmu_buf_hold_by_dnodeFunction · 0.85
dmu_buf_will_dirtyFunction · 0.85
zap_lockdir_implFunction · 0.85
mzap_upgradeFunction · 0.85
zap_unlockdirFunction · 0.85
dmu_buf_releFunction · 0.85

Tested by

no test coverage detected