ufs: Export UFS_MAXNAMLEN to pathconf, statfs

Rather than the global NAME_MAX constant.  This change is required to
support systems with a NAME_MAX/MAXNAMLEN that differs from UFS_MAXNAMLEN.

This was missed in r313475 due to the alternative spelling ("NAME_MAX") of
MAXNAMLEN.  This change is also similar in spirit to r313780.

Reported by:	ngie@
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Conrad Meyer 2017-04-05 01:44:03 +00:00
parent 1bbe19e65b
commit a96da1c3fb
2 changed files with 3 additions and 2 deletions

View File

@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <security/mac/mac_framework.h>
#include <ufs/ufs/dir.h>
#include <ufs/ufs/extattr.h>
#include <ufs/ufs/gjournal.h>
#include <ufs/ufs/quota.h>
@ -1434,7 +1435,7 @@ ffs_statfs(mp, sbp)
sbp->f_files = fs->fs_ncg * fs->fs_ipg - UFS_ROOTINO;
sbp->f_ffree = fs->fs_cstotal.cs_nifree + fs->fs_pendinginodes;
UFS_UNLOCK(ump);
sbp->f_namemax = NAME_MAX;
sbp->f_namemax = UFS_MAXNAMLEN;
return (0);
}

View File

@ -2446,7 +2446,7 @@ ufs_pathconf(ap)
*ap->a_retval = LINK_MAX;
break;
case _PC_NAME_MAX:
*ap->a_retval = NAME_MAX;
*ap->a_retval = UFS_MAXNAMLEN;
break;
case _PC_PATH_MAX:
*ap->a_retval = PATH_MAX;