Source-Changes-HG archive

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

[src/trunk]: src/sys Abolish the SAVENAME and HASBUF flags. There is now alwa...



details:   https://anonhg.NetBSD.org/src/rev/19888d87d908
branches:  trunk
changeset: 759129:19888d87d908
user:      dholland <dholland%NetBSD.org@localhost>
date:      Tue Nov 30 10:43:01 2010 +0000

description:
Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.

diffstat:

 sys/coda/coda_vnops.c             |  18 ++----------------
 sys/compat/svr4/svr4_misc.c       |   6 +++---
 sys/compat/svr4_32/svr4_32_misc.c |   6 +++---
 sys/fs/adosfs/adlookup.c          |   6 ++----
 sys/fs/efs/efs_vnops.c            |   5 ++---
 sys/fs/msdosfs/msdosfs_lookup.c   |   8 ++------
 sys/fs/msdosfs/msdosfs_vnops.c    |  17 ++---------------
 sys/fs/nilfs/nilfs_vnops.c        |   6 ++----
 sys/fs/puffs/puffs_vnops.c        |  12 ++----------
 sys/fs/smbfs/smbfs_vnops.c        |  12 ++----------
 sys/fs/sysvbfs/sysvbfs_vnops.c    |   9 ++-------
 sys/fs/tmpfs/tmpfs_subr.c         |   5 ++---
 sys/fs/tmpfs/tmpfs_vnops.c        |  10 ++--------
 sys/fs/udf/udf_vnops.c            |   6 ++----
 sys/fs/union/union_subr.c         |   8 ++++----
 sys/fs/unionfs/unionfs_subr.c     |   9 ++++-----
 sys/fs/unionfs/unionfs_vnops.c    |   6 +-----
 sys/kern/kern_exec.c              |   6 +++---
 sys/kern/vfs_lookup.c             |   5 ++---
 sys/miscfs/genfs/genfs_vnops.c    |   6 +++---
 sys/nfs/nfs_vnops.c               |  20 ++------------------
 sys/sys/namei.src                 |  18 +++++-------------
 sys/ufs/ext2fs/ext2fs_lookup.c    |  12 ++----------
 sys/ufs/ext2fs/ext2fs_vnops.c     |  21 ++-------------------
 sys/ufs/ufs/ufs_lookup.c          |  12 ++----------
 sys/ufs/ufs/ufs_vnops.c           |  25 ++++---------------------
 sys/ufs/ufs/ufs_wapbl.c           |   9 ++-------
 27 files changed, 66 insertions(+), 217 deletions(-)

diffs (truncated from 1099 to 300 lines):

diff -r a8fa590943e0 -r 19888d87d908 sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c     Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/coda/coda_vnops.c     Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: coda_vnops.c,v 1.77 2010/11/30 10:29:57 dholland Exp $ */
+/*     $NetBSD: coda_vnops.c,v 1.78 2010/11/30 10:43:01 dholland Exp $ */
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.77 2010/11/30 10:29:57 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.78 2010/11/30 10:43:01 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -997,24 +997,10 @@
        && (error == ENOENT))
     {
        error = EJUSTRETURN;
-       cnp->cn_flags |= SAVENAME;
        *ap->a_vpp = NULL;
     }
 
     /*
-     * If we are removing, and we are at the last element, and we
-     * found it, then we need to keep the name around so that the
-     * removal will go ahead as planned.
-     * XXX Check against new lookup rules.
-     */
-    if ((cnp->cn_nameiop == DELETE)
-       && (cnp->cn_flags & ISLASTCN)
-       && !error)
-    {
-       cnp->cn_flags |= SAVENAME;
-    }
-
-    /*
      * If the lookup succeeded, we must generally lock the returned
      * vnode.  This could be a ., .., or normal lookup.  See
      * vnodeops(9) for the details.
diff -r a8fa590943e0 -r 19888d87d908 sys/compat/svr4/svr4_misc.c
--- a/sys/compat/svr4/svr4_misc.c       Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/compat/svr4/svr4_misc.c       Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_misc.c,v 1.153 2010/11/30 10:29:58 dholland Exp $  */
+/*     $NetBSD: svr4_misc.c,v 1.154 2010/11/30 10:43:02 dholland Exp $  */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.153 2010/11/30 10:29:58 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_misc.c,v 1.154 2010/11/30 10:43:02 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1328,7 +1328,7 @@
                return ENOMEM;
        }
 
-       NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | TRYEMULROOT, pb);
+       NDINIT(&nd, LOOKUP, NOFOLLOW | TRYEMULROOT, pb);
        if ((error = namei(&nd)) != 0) {
                pathbuf_destroy(pb);
                return error;
diff -r a8fa590943e0 -r 19888d87d908 sys/compat/svr4_32/svr4_32_misc.c
--- a/sys/compat/svr4_32/svr4_32_misc.c Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/compat/svr4_32/svr4_32_misc.c Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_misc.c,v 1.72 2010/11/30 10:29:58 dholland Exp $        */
+/*     $NetBSD: svr4_32_misc.c,v 1.73 2010/11/30 10:43:02 dholland Exp $        */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.72 2010/11/30 10:29:58 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.73 2010/11/30 10:43:02 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1333,7 +1333,7 @@
                return error;
        }
 
-       NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | TRYEMULROOT, pb);
+       NDINIT(&nd, LOOKUP, NOFOLLOW | TRYEMULROOT, pb);
        if ((error = namei(&nd)) != 0) {
                pathbuf_destroy(pb);
                return error;
diff -r a8fa590943e0 -r 19888d87d908 sys/fs/adosfs/adlookup.c
--- a/sys/fs/adosfs/adlookup.c  Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/fs/adosfs/adlookup.c  Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adlookup.c,v 1.14 2010/06/24 13:03:08 hannken Exp $    */
+/*     $NetBSD: adlookup.c,v 1.15 2010/11/30 10:43:02 dholland Exp $   */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adlookup.c,v 1.14 2010/06/24 13:03:08 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adlookup.c,v 1.15 2010/11/30 10:43:02 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -205,7 +205,6 @@
 #endif
                        return (error);
                }
-               cnp->cn_nameiop |= SAVENAME;
 #ifdef ADOSFS_DIAGNOSTIC
                printf("EJUSTRETURN)");
 #endif
@@ -236,7 +235,6 @@
                        *vpp = NULL;
                        return (error);
                }
-               cnp->cn_flags |= SAVENAME;
                nocache = 1;
        }
        if (vdp == *vpp)
diff -r a8fa590943e0 -r 19888d87d908 sys/fs/efs/efs_vnops.c
--- a/sys/fs/efs/efs_vnops.c    Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/fs/efs/efs_vnops.c    Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: efs_vnops.c,v 1.22 2010/06/24 13:03:09 hannken Exp $   */
+/*     $NetBSD: efs_vnops.c,v 1.23 2010/11/30 10:43:02 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.22 2010/06/24 13:03:09 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.23 2010/11/30 10:43:02 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -111,7 +111,6 @@
                                    cnp->cn_cred);
                                if (err)
                                        return (err);
-                               cnp->cn_flags |= SAVENAME;
                                return (EJUSTRETURN);
                        }
                        return (err);
diff -r a8fa590943e0 -r 19888d87d908 sys/fs/msdosfs/msdosfs_lookup.c
--- a/sys/fs/msdosfs/msdosfs_lookup.c   Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/fs/msdosfs/msdosfs_lookup.c   Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_lookup.c,v 1.22 2010/07/30 16:40:43 mlelstv Exp $      */
+/*     $NetBSD: msdosfs_lookup.c,v 1.23 2010/11/30 10:43:03 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.22 2010/07/30 16:40:43 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.23 2010/11/30 10:43:03 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -381,13 +381,10 @@
                 * We return ni_vp == NULL to indicate that the entry
                 * does not currently exist; we leave a pointer to
                 * the (locked) directory inode in ndp->ni_dvp.
-                * The pathname buffer is saved so that the name
-                * can be obtained later.
                 *
                 * NB - if the directory is unlocked, then this
                 * information cannot be used.
                 */
-               cnp->cn_flags |= SAVENAME;
                return (EJUSTRETURN);
        }
 
@@ -513,7 +510,6 @@
                if ((error = deget(pmp, cluster, blkoff, &tdp)) != 0)
                        return (error);
                *vpp = DETOV(tdp);
-               cnp->cn_flags |= SAVENAME;
                return (0);
        }
 
diff -r a8fa590943e0 -r 19888d87d908 sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c    Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c    Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vnops.c,v 1.69 2010/11/30 10:29:59 dholland Exp $      */
+/*     $NetBSD: msdosfs_vnops.c,v 1.70 2010/11/30 10:43:03 dholland 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.69 2010/11/30 10:29:59 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.70 2010/11/30 10:43:03 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,10 +138,6 @@
         * use the absence of the owner write bit to make the file
         * readonly.
         */
-#ifdef DIAGNOSTIC
-       if ((cnp->cn_flags & HASBUF) == 0)
-               panic("msdosfs_create: no name");
-#endif
        memset(&ndirent, 0, sizeof(ndirent));
        if ((error = uniqdosname(pdep, cnp, ndirent.de_Name)) != 0)
                goto bad;
@@ -837,11 +833,6 @@
 
        pmp = VFSTOMSDOSFS(fdvp->v_mount);
 
-#ifdef DIAGNOSTIC
-       if ((tcnp->cn_flags & HASBUF) == 0 ||
-           (fcnp->cn_flags & HASBUF) == 0)
-               panic("msdosfs_rename: no name");
-#endif
        /*
         * Check for cross-device rename.
         */
@@ -1273,10 +1264,6 @@
         * cluster.  This will be written to an empty slot in the parent
         * directory.
         */
-#ifdef DIAGNOSTIC
-       if ((cnp->cn_flags & HASBUF) == 0)
-               panic("msdosfs_mkdir: no name");
-#endif
        if ((error = uniqdosname(pdep, cnp, ndirent.de_Name)) != 0)
                goto bad;
 
diff -r a8fa590943e0 -r 19888d87d908 sys/fs/nilfs/nilfs_vnops.c
--- a/sys/fs/nilfs/nilfs_vnops.c        Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/fs/nilfs/nilfs_vnops.c        Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.8 2010/11/30 10:29:59 dholland Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.9 2010/11/30 10:43:03 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.8 2010/11/30 10:29:59 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.9 2010/11/30 10:43:03 dholland Exp $");
 #endif /* not lint */
 
 
@@ -732,8 +732,6 @@
                        if (!error) {
                                error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred);
                                if (!error) {
-                                       /* keep the component name */
-                                       cnp->cn_flags |= SAVENAME;
                                        error = EJUSTRETURN;
                                }
                        }
diff -r a8fa590943e0 -r 19888d87d908 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c        Tue Nov 30 10:32:46 2010 +0000
+++ b/sys/fs/puffs/puffs_vnops.c        Tue Nov 30 10:43:01 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_vnops.c,v 1.148 2010/11/30 10:29:59 dholland Exp $       */
+/*     $NetBSD: puffs_vnops.c,v 1.149 2010/11/30 10:43:03 dholland Exp $       */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.148 2010/11/30 10:29:59 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.149 2010/11/30 10:43:03 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -541,7 +541,6 @@
                        } else if ((cnp->cn_flags & ISLASTCN)
                            && (cnp->cn_nameiop == CREATE
                              || cnp->cn_nameiop == RENAME)) {
-                               cnp->cn_flags |= SAVENAME;
                                error = EJUSTRETURN;



Home | Main Index | Thread Index | Old Index