Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Add newly created vnodes to the namei cache. The rest of...



details:   https://anonhg.NetBSD.org/src/rev/1cc14d5da07b
branches:  trunk
changeset: 459619:1cc14d5da07b
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Sep 18 17:59:14 2019 +0000

description:
Add newly created vnodes to the namei cache. The rest of the filesystems
already did that (or they don't support writing). Discussed in tech-kern.

diffstat:

 sys/fs/msdosfs/msdosfs_vnops.c |  6 ++++--
 sys/fs/tmpfs/tmpfs_subr.c      |  5 +++--
 sys/fs/udf/udf_subr.c          |  5 +++--
 sys/ufs/chfs/chfs_vnode.c      |  4 +++-
 sys/ufs/ext2fs/ext2fs_vnops.c  |  5 +++--
 sys/ufs/lfs/lfs_vnops.c        |  5 +++--
 sys/ufs/ufs/ufs_vnops.c        |  5 +++--
 7 files changed, 22 insertions(+), 13 deletions(-)

diffs (175 lines):

diff -r 92def30174e3 -r 1cc14d5da07b sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c    Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c    Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vnops.c,v 1.98 2017/04/26 03:02:48 riastradh Exp $     */
+/*     $NetBSD: msdosfs_vnops.c,v 1.99 2019/09/18 17:59:14 christos Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.98 2017/04/26 03:02:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.99 2019/09/18 17:59:14 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -153,6 +153,8 @@
                goto bad;
        VN_KNOTE(ap->a_dvp, NOTE_WRITE);
        *ap->a_vpp = DETOV(dep);
+       cache_enter(ap->a_dvp, *ap->a_vpp, cnp->cn_nameptr, cnp->cn_namelen,
+           cnp->cn_flags);
        return (0);
 
 bad:
diff -r 92def30174e3 -r 1cc14d5da07b sys/fs/tmpfs/tmpfs_subr.c
--- a/sys/fs/tmpfs/tmpfs_subr.c Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/fs/tmpfs/tmpfs_subr.c Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_subr.c,v 1.104 2019/01/01 10:06:54 hannken Exp $ */
+/*     $NetBSD: tmpfs_subr.c,v 1.105 2019/09/18 17:59:15 christos Exp $        */
 
 /*
  * Copyright (c) 2005-2013 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.104 2019/01/01 10:06:54 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.105 2019/09/18 17:59:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/cprng.h>
@@ -434,6 +434,7 @@
 
        VOP_UNLOCK(*vpp);
 
+       cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
        return 0;
 }
 
diff -r 92def30174e3 -r 1cc14d5da07b sys/fs/udf/udf_subr.c
--- a/sys/fs/udf/udf_subr.c     Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/fs/udf/udf_subr.c     Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.146 2019/06/03 06:04:20 msaitoh Exp $ */
+/* $NetBSD: udf_subr.c,v 1.147 2019/09/18 17:59:15 christos Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.146 2019/06/03 06:04:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.147 2019/09/18 17:59:15 christos Exp $");
 #endif /* not lint */
 
 
@@ -5963,6 +5963,7 @@
        /* adjust file count */
        udf_adjust_filecount(udf_node, 1);
 
+       cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
        return 0;
 }
 
diff -r 92def30174e3 -r 1cc14d5da07b sys/ufs/chfs/chfs_vnode.c
--- a/sys/ufs/chfs/chfs_vnode.c Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/ufs/chfs/chfs_vnode.c Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chfs_vnode.c,v 1.15 2017/04/01 19:35:57 riastradh Exp $        */
+/*     $NetBSD: chfs_vnode.c,v 1.16 2019/09/18 17:59:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -310,6 +310,8 @@
 
        VOP_UNLOCK(vp);
        *vpp = vp;
+       cache_enter(pdir, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
+           cnp->cn_flags);
        return (0);
 }
 
diff -r 92def30174e3 -r 1cc14d5da07b sys/ufs/ext2fs/ext2fs_vnops.c
--- a/sys/ufs/ext2fs/ext2fs_vnops.c     Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c     Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vnops.c,v 1.129 2019/01/01 10:06:55 hannken Exp $       */
+/*     $NetBSD: ext2fs_vnops.c,v 1.130 2019/09/18 17:59:15 christos Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.129 2019/01/01 10:06:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.130 2019/09/18 17:59:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1045,6 +1045,7 @@
        }
 
        *vpp = tvp;
+       cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
        return 0;
 
 bad:
diff -r 92def30174e3 -r 1cc14d5da07b sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.324 2019/06/20 00:49:11 christos Exp $ */
+/*     $NetBSD: lfs_vnops.c,v 1.325 2019/09/18 17:59:15 christos Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.324 2019/06/20 00:49:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.325 2019/09/18 17:59:15 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -405,6 +405,7 @@
        if (error)
                goto bad;
        *vpp = tvp;
+       cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
        KASSERT(VOP_ISLOCKED(*vpp) == LK_EXCLUSIVE);
        return (0);
 
diff -r 92def30174e3 -r 1cc14d5da07b sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c   Wed Sep 18 16:18:12 2019 +0000
+++ b/sys/ufs/ufs/ufs_vnops.c   Wed Sep 18 17:59:14 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_vnops.c,v 1.247 2019/07/01 00:57:06 dholland Exp $ */
+/*     $NetBSD: ufs_vnops.c,v 1.248 2019/09/18 17:59:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.247 2019/07/01 00:57:06 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.248 2019/09/18 17:59:15 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1909,6 +1909,7 @@
        if (error)
                goto bad;
        *vpp = tvp;
+       cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags);
        return (0);
 
  bad:



Home | Main Index | Thread Index | Old Index