* 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
| 698 | * of them may be supplied. |
| 699 | */ |
| 700 | void |
| 701 | mzap_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 | |
| 726 | static uint64_t |
| 727 | zap_create_impl(objset_t *os, int normflags, zap_flags_t flags, |
no test coverage detected