Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 2017 01:44:03 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316509 - in head/sys/ufs: ffs ufs
Message-ID:  <201704050144.v351i3N4092979@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Wed Apr  5 01:44:03 2017
New Revision: 316509
URL: https://svnweb.freebsd.org/changeset/base/316509

Log:
  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

Modified:
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Tue Apr  4 23:30:05 2017	(r316508)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Wed Apr  5 01:44:03 2017	(r316509)
@@ -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);
 }
 

Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c	Tue Apr  4 23:30:05 2017	(r316508)
+++ head/sys/ufs/ufs/ufs_vnops.c	Wed Apr  5 01:44:03 2017	(r316509)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704050144.v351i3N4092979>