summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-10-12 11:41:26 -0300
committerRenato Botelho <renato@netgate.com>2016-10-12 11:41:26 -0300
commitcb642130dfc50717bb970a104c44aa7690930a38 (patch)
treec67f108534217a209198c6b201949ecc73acaba3 /sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c
parent5dd7ab172435dc99e1abc1f7d73fd5e720050bbc (diff)
parentcd04fbc5e631c6b3e80a14eb7044c3be35fba2d2 (diff)
downloadFreeBSD-src-cb642130dfc50717bb970a104c44aa7690930a38.zip
FreeBSD-src-cb642130dfc50717bb970a104c44aa7690930a38.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c')
-rw-r--r--sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c b/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c
index a32955f..439d449 100644
--- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c
+++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c
@@ -69,7 +69,7 @@ zfs_component_namecheck(const char *path, namecheck_err_t *why, char *what)
{
const char *loc;
- if (strlen(path) >= MAXNAMELEN) {
+ if (strlen(path) >= ZFS_MAX_DATASET_NAME_LEN) {
if (why)
*why = NAME_ERR_TOOLONG;
return (-1);
@@ -140,14 +140,9 @@ dataset_namecheck(const char *path, namecheck_err_t *why, char *what)
/*
* Make sure the name is not too long.
- *
- * ZFS_MAXNAMELEN is the maximum dataset length used in the userland
- * which is the same as MAXNAMELEN used in the kernel.
- * If ZFS_MAXNAMELEN value is changed, make sure to cleanup all
- * places using MAXNAMELEN.
*/
- if (strlen(path) >= MAXNAMELEN) {
+ if (strlen(path) >= ZFS_MAX_DATASET_NAME_LEN) {
if (why)
*why = NAME_ERR_TOOLONG;
return (-1);
@@ -276,7 +271,7 @@ mountpoint_namecheck(const char *path, namecheck_err_t *why)
while (*end != '/' && *end != '\0')
end++;
- if (end - start >= MAXNAMELEN) {
+ if (end - start >= ZFS_MAX_DATASET_NAME_LEN) {
if (why)
*why = NAME_ERR_TOOLONG;
return (-1);
@@ -301,13 +296,8 @@ pool_namecheck(const char *pool, namecheck_err_t *why, char *what)
/*
* Make sure the name is not too long.
- *
- * ZPOOL_MAXNAMELEN is the maximum pool length used in the userland
- * which is the same as MAXNAMELEN used in the kernel.
- * If ZPOOL_MAXNAMELEN value is changed, make sure to cleanup all
- * places using MAXNAMELEN.
*/
- if (strlen(pool) >= MAXNAMELEN) {
+ if (strlen(pool) >= ZFS_MAX_DATASET_NAME_LEN) {
if (why)
*why = NAME_ERR_TOOLONG;
return (-1);
OpenPOWER on IntegriCloud