Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Excise struct componentname from the namecache.
details: https://anonhg.NetBSD.org/src/rev/ea16eb76087c
branches: trunk
changeset: 782540:ea16eb76087c
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Nov 05 17:27:37 2012 +0000
description:
Excise struct componentname from the namecache.
This uglifies the interface, because several operations need to be
passed the namei flags and cache_lookup also needs for the time being
to be passed cnp->cn_nameiop. Nonetheless, it's a net benefit.
The glop should be able to go away eventually but requires structural
cleanup elsewhere first.
This change requires a kernel bump.
diffstat:
sys/fs/adosfs/adlookup.c | 13 ++++--
sys/fs/cd9660/cd9660_lookup.c | 11 +++--
sys/fs/efs/efs_vnops.c | 13 ++++--
sys/fs/filecorefs/filecore_lookup.c | 13 ++++--
sys/fs/msdosfs/msdosfs_lookup.c | 12 +++--
sys/fs/nilfs/nilfs_vnops.c | 10 +++--
sys/fs/ntfs/ntfs_vnops.c | 10 +++--
sys/fs/puffs/puffs_msgif.c | 6 +-
sys/fs/puffs/puffs_node.c | 7 ++-
sys/fs/puffs/puffs_vnops.c | 14 ++++--
sys/fs/smbfs/smbfs_vnops.c | 20 +++++++---
sys/fs/tmpfs/tmpfs_vnops.c | 11 +++--
sys/fs/udf/udf_vnops.c | 10 +++--
sys/fs/unionfs/unionfs_vnops.c | 9 +++-
sys/kern/vfs_cache.c | 68 +++++++++++++++++++-----------------
sys/nfs/nfs_vnops.c | 29 ++++++++-------
sys/sys/namei.src | 13 +++---
sys/ufs/chfs/chfs_vnops.c | 8 ++-
sys/ufs/ext2fs/ext2fs_lookup.c | 12 +++--
sys/ufs/ufs/ufs_lookup.c | 12 +++--
20 files changed, 174 insertions(+), 127 deletions(-)
diffs (truncated from 1089 to 300 lines):
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/adosfs/adlookup.c
--- a/sys/fs/adosfs/adlookup.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/adosfs/adlookup.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adlookup.c,v 1.17 2012/11/05 17:24:09 dholland Exp $ */
+/* $NetBSD: adlookup.c,v 1.18 2012/11/05 17:27:37 dholland Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adlookup.c,v 1.17 2012/11/05 17:24:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adlookup.c,v 1.18 2012/11/05 17:27:37 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -110,7 +110,8 @@
* check the name cache to see if the directory/name pair
* we are looking for is known already.
*/
- if (cache_lookup(vdp, cnp, NULL, vpp)) {
+ if (cache_lookup(vdp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) {
return *vpp == NULLVP ? ENOENT : 0;
}
@@ -212,7 +213,8 @@
return(EJUSTRETURN);
}
if (nameiop != CREATE)
- cache_enter(vdp, NULL, cnp);
+ cache_enter(vdp, NULL, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
#ifdef ADOSFS_DIAGNOSTIC
printf("ENOENT)");
#endif
@@ -242,7 +244,8 @@
vref(vdp);
found_lockdone:
if (nocache == 0)
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
#ifdef ADOSFS_DIAGNOSTIC
printf("0)\n");
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/cd9660/cd9660_lookup.c
--- a/sys/fs/cd9660/cd9660_lookup.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/cd9660/cd9660_lookup.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_lookup.c,v 1.21 2012/11/05 17:24:09 dholland Exp $ */
+/* $NetBSD: cd9660_lookup.c,v 1.22 2012/11/05 17:27:37 dholland Exp $ */
/*-
* Copyright (c) 1989, 1993, 1994
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_lookup.c,v 1.21 2012/11/05 17:24:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_lookup.c,v 1.22 2012/11/05 17:27:37 dholland Exp $");
#include <sys/param.h>
#include <sys/namei.h>
@@ -151,7 +151,8 @@
* check the name cache to see if the directory/name pair
* we are looking for is known already.
*/
- if (cache_lookup(vdp, cnp, NULL, vpp)) {
+ if (cache_lookup(vdp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) {
return *vpp == NULLVP ? ENOENT : 0;
}
@@ -337,7 +338,7 @@
/*
* Insert name into cache (as non-existent) if appropriate.
*/
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
return (nameiop == CREATE || nameiop == RENAME) ? EROFS : ENOENT;
found:
@@ -400,7 +401,7 @@
/*
* Insert name into cache if appropriate.
*/
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
return 0;
}
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/efs/efs_vnops.c
--- a/sys/fs/efs/efs_vnops.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/efs/efs_vnops.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efs_vnops.c,v 1.27 2012/11/05 17:24:09 dholland Exp $ */
+/* $NetBSD: efs_vnops.c,v 1.28 2012/11/05 17:27:37 dholland Exp $ */
/*
* Copyright (c) 2006 Stephen M. Rumble <rumble%ephemeral.org@localhost>
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.27 2012/11/05 17:24:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.28 2012/11/05 17:27:37 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -73,7 +73,8 @@
if (err)
return (err);
- if (cache_lookup(ap->a_dvp, cnp, NULL, ap->a_vpp)) {
+ if (cache_lookup(ap->a_dvp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, ap->a_vpp)) {
return *ap->a_vpp == NULLVP ? ENOENT : 0;
}
@@ -103,7 +104,8 @@
EFS_VTOI(ap->a_dvp), ap->a_cnp, &ino);
if (err) {
if (err == ENOENT && nameiop != CREATE)
- cache_enter(ap->a_dvp, NULL, cnp);
+ cache_enter(ap->a_dvp, NULL, cnp->cn_nameptr,
+ cnp->cn_namelen, cnp->cn_flags);
if (err == ENOENT && (nameiop == CREATE ||
nameiop == RENAME)) {
err = VOP_ACCESS(ap->a_dvp, VWRITE,
@@ -120,7 +122,8 @@
*ap->a_vpp = vp;
}
- cache_enter(ap->a_dvp, *ap->a_vpp, cnp);
+ cache_enter(ap->a_dvp, *ap->a_vpp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
return 0;
}
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/filecorefs/filecore_lookup.c
--- a/sys/fs/filecorefs/filecore_lookup.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/filecorefs/filecore_lookup.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_lookup.c,v 1.15 2012/11/05 17:24:09 dholland Exp $ */
+/* $NetBSD: filecore_lookup.c,v 1.16 2012/11/05 17:27:37 dholland Exp $ */
/*-
* Copyright (c) 1989, 1993, 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_lookup.c,v 1.15 2012/11/05 17:24:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_lookup.c,v 1.16 2012/11/05 17:27:37 dholland Exp $");
#include <sys/param.h>
#include <sys/namei.h>
@@ -169,7 +169,8 @@
* check the name cache to see if the directory/name pair
* we are looking for is known already.
*/
- if (cache_lookup(vdp, cnp, NULL, vpp)) {
+ if (cache_lookup(vdp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) {
return *vpp == NULLVP ? ENOENT : 0;
}
@@ -247,7 +248,8 @@
/*
* Insert name into cache (as non-existent) if appropriate.
*/
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
return (nameiop == CREATE || nameiop == RENAME) ? EROFS : ENOENT;
found:
@@ -315,6 +317,7 @@
/*
* Insert name into cache if appropriate.
*/
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
return 0;
}
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/msdosfs/msdosfs_lookup.c
--- a/sys/fs/msdosfs/msdosfs_lookup.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/msdosfs/msdosfs_lookup.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_lookup.c,v 1.25 2012/11/05 17:24:10 dholland Exp $ */
+/* $NetBSD: msdosfs_lookup.c,v 1.26 2012/11/05 17:27:37 dholland Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.25 2012/11/05 17:24:10 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.26 2012/11/05 17:27:37 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -146,7 +146,8 @@
* check the name cache to see if the directory/name pair
* we are looking for is known already.
*/
- if (cache_lookup(vdp, cnp, NULL, vpp)) {
+ if (cache_lookup(vdp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) {
return *vpp == NULLVP ? ENOENT: 0;
}
@@ -401,7 +402,8 @@
* for 'FOO'.
*/
if (nameiop != CREATE)
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
#endif
return (ENOENT);
@@ -554,7 +556,7 @@
/*
* Insert name into cache if appropriate.
*/
- cache_enter(vdp, *vpp, cnp);
+ cache_enter(vdp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
return 0;
}
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/nilfs/nilfs_vnops.c
--- a/sys/fs/nilfs/nilfs_vnops.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/nilfs/nilfs_vnops.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.19 2012/11/05 17:24:10 dholland Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.20 2012/11/05 17:27:37 dholland Exp $ */
/*
* Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.19 2012/11/05 17:24:10 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.20 2012/11/05 17:27:37 dholland Exp $");
#endif /* not lint */
@@ -653,7 +653,8 @@
DPRINTF(LOOKUP, ("\tlooking up cnp->cn_nameptr '%s'\n",
cnp->cn_nameptr));
/* look in the namecache */
- if (cache_lookup(dvp, cnp, NULL, vpp)) {
+ if (cache_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) {
return *vpp == NULLVP ? ENOENT : 0;
}
@@ -761,7 +762,8 @@
* might be seen as negative caching.
*/
if (nameiop != CREATE)
- cache_enter(dvp, *vpp, cnp);
+ cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_flags);
DPRINTFIF(LOOKUP, error, ("nilfs_lookup returing error %d\n", error));
diff -r 593b009bc3ce -r ea16eb76087c sys/fs/ntfs/ntfs_vnops.c
--- a/sys/fs/ntfs/ntfs_vnops.c Mon Nov 05 17:24:39 2012 +0000
+++ b/sys/fs/ntfs/ntfs_vnops.c Mon Nov 05 17:27:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vnops.c,v 1.53 2012/11/05 17:24:10 dholland Exp $ */
+/* $NetBSD: ntfs_vnops.c,v 1.54 2012/11/05 17:27:38 dholland Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.53 2012/11/05 17:24:10 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.54 2012/11/05 17:27:38 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -682,7 +682,8 @@
* check the name cache to see if the directory/name pair
* we are looking for is known already.
*/
- if (cache_lookup(ap->a_dvp, cnp, NULL, ap->a_vpp)) {
+ if (cache_lookup(ap->a_dvp, cnp->cn_nameptr, cnp->cn_namelen,
+ cnp->cn_nameiop, cnp->cn_flags, NULL, ap->a_vpp)) {
return *ap->a_vpp == NULLVP ? ENOENT : 0;
Home |
Main Index |
Thread Index |
Old Index