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

Function zfs_dropname

freebsd/contrib/openzfs/module/os/linux/zfs/zfs_dir.c:903–927  ·  view source on GitHub ↗

* The match type in the code for this function should conform to: * * ------------------------------------------------------------------------ * fs type | z_norm | lookup type | match type * ---------|-------------|-------------|---------------------------------- * CS !norm | 0 | 0 | 0 (exact) * CS norm | formX | 0 | MT_NORMALIZE * CI !norm | upper

Source from the content-addressed store, hash-verified

901 * formX = unicode normalization form set on fs creation
902 */
903static int
904zfs_dropname(zfs_dirlock_t *dl, znode_t *zp, znode_t *dzp, dmu_tx_t *tx,
905 int flag)
906{
907 int error;
908
909 if (ZTOZSB(zp)->z_norm) {
910 matchtype_t mt = MT_NORMALIZE;
911
912 if ((ZTOZSB(zp)->z_case == ZFS_CASE_INSENSITIVE &&
913 (flag & ZCIEXACT)) ||
914 (ZTOZSB(zp)->z_case == ZFS_CASE_MIXED &&
915 !(flag & ZCILOOK))) {
916 mt |= MT_MATCH_CASE;
917 }
918
919 error = zap_remove_norm(ZTOZSB(zp)->z_os, dzp->z_id,
920 dl->dl_name, mt, tx);
921 } else {
922 error = zap_remove(ZTOZSB(zp)->z_os, dzp->z_id, dl->dl_name,
923 tx);
924 }
925
926 return (error);
927}
928
929/*
930 * Unlink zp from dl, and mark zp for deletion if this was the last link. Can

Callers 1

zfs_link_destroyFunction · 0.70

Calls 2

zap_remove_normFunction · 0.85
zap_removeFunction · 0.85

Tested by

no test coverage detected