Module Name:    src
Committed By:   christos
Date:           Tue Sep 27 01:10:44 UTC 2011

Modified Files:
        src/sys/fs/tmpfs: tmpfs.h tmpfs_vfsops.c tmpfs_vnops.c

Log Message:
define and use TMPFS_MAXNAMLEN instead of MAXNAMLEN


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/fs/tmpfs/tmpfs.h
cvs rdiff -u -r1.51 -r1.52 src/sys/fs/tmpfs/tmpfs_vfsops.c
cvs rdiff -u -r1.90 -r1.91 src/sys/fs/tmpfs/tmpfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/tmpfs/tmpfs.h
diff -u src/sys/fs/tmpfs/tmpfs.h:1.44 src/sys/fs/tmpfs/tmpfs.h:1.45
--- src/sys/fs/tmpfs/tmpfs.h:1.44	Sun May 29 18:29:06 2011
+++ src/sys/fs/tmpfs/tmpfs.h	Mon Sep 26 21:10:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs.h,v 1.44 2011/05/29 22:29:06 rmind Exp $	*/
+/*	$NetBSD: tmpfs.h,v 1.45 2011/09/27 01:10:43 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -63,8 +63,9 @@ TAILQ_HEAD(tmpfs_dir, tmpfs_dirent);
 
 #if defined(_KERNEL)
 
+#define TMPFS_MAXNAMLEN	255
 /* Validate maximum td_namelen length. */
-CTASSERT(MAXNAMLEN < UINT16_MAX);
+CTASSERT(TMPFS_MAXNAMLEN < UINT16_MAX);
 
 #define	TMPFS_DIRCOOKIE_DOT	0
 #define	TMPFS_DIRCOOKIE_DOTDOT	1

Index: src/sys/fs/tmpfs/tmpfs_vfsops.c
diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.51 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.52
--- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.51	Sun May 29 18:29:07 2011
+++ src/sys/fs/tmpfs/tmpfs_vfsops.c	Mon Sep 26 21:10:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vfsops.c,v 1.51 2011/05/29 22:29:07 rmind Exp $	*/
+/*	$NetBSD: tmpfs_vfsops.c,v 1.52 2011/09/27 01:10:43 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.51 2011/05/29 22:29:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.52 2011/09/27 01:10:43 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -181,7 +181,7 @@ tmpfs_mount(struct mount *mp, const char
 
 	mp->mnt_data = tmp;
 	mp->mnt_flag |= MNT_LOCAL;
-	mp->mnt_stat.f_namemax = MAXNAMLEN;
+	mp->mnt_stat.f_namemax = TMPFS_MAXNAMLEN;
 	mp->mnt_fs_bshift = PAGE_SHIFT;
 	mp->mnt_dev_bshift = DEV_BSHIFT;
 	mp->mnt_iflag |= IMNT_MPSAFE;

Index: src/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.90 src/sys/fs/tmpfs/tmpfs_vnops.c:1.91
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.90	Sat Aug 27 11:32:28 2011
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Mon Sep 26 21:10:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.90 2011/08/27 15:32:28 hannken Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.91 2011/09/27 01:10:43 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.90 2011/08/27 15:32:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.91 2011/09/27 01:10:43 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -1119,7 +1119,7 @@ tmpfs_sane_rename(struct vnode *fdvp, st
 	 * we can't sleep, hence the early allocation above.
 	 */
 	if (newname != NULL) {
-		KASSERT(tcnp->cn_namelen <= MAXNAMLEN);
+		KASSERT(tcnp->cn_namelen <= TMPFS_MAXNAMLEN);
 
 		tmpfs_strname_free(tmpfs, fde->td_name, fde->td_namelen);
 		fde->td_namelen = (uint16_t)tcnp->cn_namelen;

Reply via email to