From 583db400307a2d4fc12d11c8a644f9faa9fa077b Mon Sep 17 00:00:00 2001 From: rmacklem <64620010+rmacklem@users.noreply.github.com> Date: Sat, 8 Nov 2025 10:20:23 -0800 Subject: [PATCH] FreeBSD: Add support for _PC_CASE_INSENSITIVE FreeBSD now has a pathconf name called _PC_CASE_INSENSITIVE used to check if a file system performs case insensitive name lookups. This patch adds support for this name. Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Signed-off-by: Rick Macklem Closes #17908 --- module/os/freebsd/zfs/zfs_vnops_os.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index 6dfabe0d6..b2b347361 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -5760,7 +5760,7 @@ zfs_freebsd_pathconf(struct vop_pathconf_args *ap) { ulong_t val; int error; -#ifdef _PC_CLONE_BLKSIZE +#if defined(_PC_CLONE_BLKSIZE) || defined(_PC_CASE_INSENSITIVE) zfsvfs_t *zfsvfs; #endif @@ -5823,6 +5823,15 @@ zfs_freebsd_pathconf(struct vop_pathconf_args *ap) else *ap->a_retval = 0; return (0); +#endif +#ifdef _PC_CASE_INSENSITIVE + case _PC_CASE_INSENSITIVE: + zfsvfs = (zfsvfs_t *)ap->a_vp->v_mount->mnt_data; + if (zfsvfs->z_case == ZFS_CASE_INSENSITIVE) + *ap->a_retval = 1; + else + *ap->a_retval = 0; + return (0); #endif default: return (vop_stdpathconf(ap));