Author: mjg
Date: Sun Aug 16 17:55:20 2020
New Revision: 364273
URL: https://svnweb.freebsd.org/changeset/base/364273

Log:
  vfs: mark HASBUF as an internal flag
  
  There is no setter for cn_pnbuf.

Modified:
  head/sys/kern/vfs_lookup.c
  head/sys/sys/namei.h

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c  Sun Aug 16 17:19:23 2020        (r364272)
+++ head/sys/kern/vfs_lookup.c  Sun Aug 16 17:55:20 2020        (r364273)
@@ -504,8 +504,7 @@ namei(struct nameidata *ndp)
         * Get a buffer for the name to be translated, and copy the
         * name into the buffer.
         */
-       if ((cnp->cn_flags & HASBUF) == 0)
-               cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
+       cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
        if (ndp->ni_segflg == UIO_SYSSPACE)
                error = copystr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN,
                    &ndp->ni_pathlen);

Modified: head/sys/sys/namei.h
==============================================================================
--- head/sys/sys/namei.h        Sun Aug 16 17:19:23 2020        (r364272)
+++ head/sys/sys/namei.h        Sun Aug 16 17:55:20 2020        (r364273)
@@ -149,21 +149,21 @@ int       cache_fplookup(struct nameidata *ndp, enum 
cache_f
  * buffer and for vrele'ing ni_startdir.
  */
 #define        RDONLY          0x00000200 /* lookup with read-only semantics */
-#define        HASBUF          0x00000400 /* has allocated pathname buffer */
-#define        SAVENAME        0x00000800 /* save pathname buffer */
-#define        SAVESTART       0x00001000 /* save starting directory */
-#define        ISWHITEOUT      0x00002000 /* found whiteout */
-#define        DOWHITEOUT      0x00004000 /* do whiteouts */
-#define        WILLBEDIR       0x00008000 /* new files will be dirs; allow 
trailing / */
-#define        ISOPEN          0x00010000 /* caller is opening; return a real 
vnode. */
-#define        NOCROSSMOUNT    0x00020000 /* do not cross mount points */
-#define        NOMACCHECK      0x00040000 /* do not perform MAC checks */
-#define        AUDITVNODE1     0x00080000 /* audit the looked up vnode 
information */
-#define        AUDITVNODE2     0x00100000 /* audit the looked up vnode 
information */
-#define        NOCAPCHECK      0x00200000 /* do not perform capability checks 
*/
+#define        SAVENAME        0x00000400 /* save pathname buffer */
+#define        SAVESTART       0x00000800 /* save starting directory */
+#define        ISWHITEOUT      0x00001000 /* found whiteout */
+#define        DOWHITEOUT      0x00002000 /* do whiteouts */
+#define        WILLBEDIR       0x00004000 /* new files will be dirs; allow 
trailing / */
+#define        ISOPEN          0x00008000 /* caller is opening; return a real 
vnode. */
+#define        NOCROSSMOUNT    0x00010000 /* do not cross mount points */
+#define        NOMACCHECK      0x00020000 /* do not perform MAC checks */
+#define        AUDITVNODE1     0x00040000 /* audit the looked up vnode 
information */
+#define        AUDITVNODE2     0x00080000 /* audit the looked up vnode 
information */
+#define        NOCAPCHECK      0x00100000 /* do not perform capability checks 
*/
 /* UNUSED              0x00400000 */
+/* UNUSED              0x00200000 */
 /* UNUSED              0x00800000 */
-/* UNUSED              0x01000000 */
+#define        HASBUF          0x01000000 /* has allocated pathname buffer */
 #define        NOEXECCHECK     0x02000000 /* do not perform exec check on dir 
*/
 #define        MAKEENTRY       0x04000000 /* entry is to be added to name 
cache */
 #define        ISSYMLINK       0x08000000 /* symlink needs interpretation */
@@ -176,7 +176,8 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f
  * Flags which must not be passed in by callers.
  */
 #define NAMEI_INTERNAL_FLAGS   \
-       (NOEXECCHECK | MAKEENTRY | ISSYMLINK | ISLASTCN | ISDOTDOT | 
TRAILINGSLASH)
+       (HASBUF | NOEXECCHECK | MAKEENTRY | ISSYMLINK | ISLASTCN | ISDOTDOT | \
+        TRAILINGSLASH)
 
 /*
  * Namei results flags
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to