diff options
-rw-r--r-- | sys/kern/vfs_cache.c | 8 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 5 | ||||
-rw-r--r-- | sys/sys/namei.h | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index f4ded2324e1..49ff3644fac 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cache.c,v 1.34 2012/01/04 18:11:51 beck Exp $ */ +/* $OpenBSD: vfs_cache.c,v 1.35 2013/03/27 01:56:50 tedu Exp $ */ /* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */ /* @@ -48,7 +48,7 @@ /* * For simplicity (and economy of storage), names longer than - * a maximum length of NCHNAMLEN are not cached; they occur + * a maximum length of NAMECACHE_MAXLEN are not cached; they occur * infrequently in any case, and are almost never of interest. * * Upon reaching the last segment of a path, if the reference @@ -148,7 +148,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, cnp->cn_flags &= ~MAKEENTRY; return (-1); } - if (cnp->cn_namelen > NCHNAMLEN) { + if (cnp->cn_namelen > NAMECACHE_MAXLEN) { nchstats.ncs_long++; cnp->cn_flags &= ~MAKEENTRY; return (-1); @@ -342,7 +342,7 @@ cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) { struct namecache *ncp, *lncp; - if (!doingcache || cnp->cn_namelen > NCHNAMLEN) + if (!doingcache || cnp->cn_namelen > NAMECACHE_MAXLEN) return; /* diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 3b3e6f368f3..5e53298ab64 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.140 2012/11/17 22:28:26 deraadt Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.141 2013/03/27 01:56:50 tedu Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -2455,7 +2455,8 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred, info.nmi_md = mdsav2; dp->d_type = IFTODT( VTTOIF(np->n_vattr.va_type)); - if (cnp->cn_namelen <= NCHNAMLEN) { + if (cnp->cn_namelen <= + NAMECACHE_MAXLEN) { ndp->ni_vp = newvp; cache_purge(ndp->ni_dvp); nfs_cache_enter(ndp->ni_dvp, diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 31ed038ed90..c425dc6f8ab 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -1,4 +1,4 @@ -/* $OpenBSD: namei.h,v 1.27 2011/09/30 03:43:27 guenther Exp $ */ +/* $OpenBSD: namei.h,v 1.28 2013/03/27 01:56:50 tedu Exp $ */ /* $NetBSD: namei.h,v 1.11 1996/02/09 18:25:20 christos Exp $ */ /* @@ -165,7 +165,7 @@ struct nameidata { * names looked up by namei. */ -#define NCHNAMLEN 31 /* maximum name segment length we bother with */ +#define NAMECACHE_MAXLEN 31 /* maximum name segment length we bother with */ struct namecache { TAILQ_ENTRY(namecache) nc_lru; /* Regular Entry LRU chain */ @@ -177,7 +177,7 @@ struct namecache { struct vnode *nc_vp; /* vnode the name refers to */ u_long nc_vpid; /* capability number of nc_vp */ char nc_nlen; /* length of name */ - char nc_name[NCHNAMLEN]; /* segment name */ + char nc_name[NAMECACHE_MAXLEN]; /* segment name */ }; #ifdef _KERNEL |