aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-12-19 19:51:36 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2017-12-19 19:51:36 +0000
commit599afe53a8fa0bdef852e2464293801d7b61fe88 (patch)
treed14136a39450f17c0bb0fac46ffb1a295bb1421a /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
parent2dd51e16ca5b8a28d5d917c66ebb6998cf2c344d (diff)
downloadsrc-599afe53a8fa0bdef852e2464293801d7b61fe88.tar.gz
src-599afe53a8fa0bdef852e2464293801d7b61fe88.zip
Move NAME_MAX, LINK_MAX, and CHOWN_RESTRICTED out of vop_stdpathconf().
Having all filesystems fall through to default values isn't always correct and these values can vary for different filesystem implementations. Most of these changes just use the existing default values with a few exceptions: - Don't report CHOWN_RESTRICTED for ZFS since it doesn't do the exact permissions check this claims for chown(). - Use NANDFS_NAME_LEN for NAME_MAX for nandfs. - Don't report a LINK_MAX of 0 on smbfs. Now fail with EINVAL to indicate hard links aren't supported. Requested by: bde (though perhaps not this exact implementation) Reviewed by: kib (earlier version) MFC after: 1 month Sponsored by: Chelsio Communications
Notes
Notes: svn path=/head/; revision=326993
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index cb6ba9979886..def820a2f138 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -5403,11 +5403,20 @@ zfs_freebsd_pathconf(ap)
int error;
error = zfs_pathconf(ap->a_vp, ap->a_name, &val, curthread->td_ucred, NULL);
- if (error == 0)
+ if (error == 0) {
*ap->a_retval = val;
- else if (error == EOPNOTSUPP)
- error = vop_stdpathconf(ap);
- return (error);
+ return (error);
+ }
+ if (error != EOPNOTSUPP)
+ return (error);
+
+ switch (ap->a_name) {
+ case _PC_NAME_MAX:
+ *ap->a_retval = NAME_MAX;
+ return (0);
+ default:
+ return (vop_stdpathconf(ap));
+ }
}
static int