Source-Changes-HG archive

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

[src/chs-ubc2]: src/sys Update from trunk.



details:   https://anonhg.NetBSD.org/src/rev/95673b9dd41b
branches:  chs-ubc2
changeset: 471442:95673b9dd41b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Aug 02 22:30:25 1999 +0000

description:
Update from trunk.

diffstat:

 sys/miscfs/umapfs/umap.h        |   48 ++-
 sys/miscfs/umapfs/umap_subr.c   |  333 ++--------------------
 sys/miscfs/umapfs/umap_vfsops.c |  294 ++++---------------
 sys/miscfs/umapfs/umap_vnops.c  |  365 ++++++++++---------------
 sys/miscfs/union/union.h        |    4 +-
 sys/miscfs/union/union_subr.c   |    8 +-
 sys/miscfs/union/union_vfsops.c |   16 +-
 sys/miscfs/union/union_vnops.c  |  155 +++++++++-
 sys/msdosfs/denode.h            |   16 +-
 sys/msdosfs/fat.h               |    4 +-
 sys/msdosfs/msdosfs_fat.c       |   18 +-
 sys/msdosfs/msdosfs_lookup.c    |   39 ++-
 sys/msdosfs/msdosfs_vfsops.c    |    8 +-
 sys/msdosfs/msdosfs_vnops.c     |   52 +---
 sys/net/if.c                    |    4 +-
 sys/net/if.h                    |   13 +-
 sys/net/if_faith.c              |    4 +-
 sys/net/if_gif.h                |    4 +
 sys/net/if_ppp.c                |   75 +++++-
 sys/net/if_pppvar.h             |    5 +-
 sys/net/if_spppsubr.c           |   29 +-
 sys/net/pfkeyv2.h               |   36 ++
 sys/net/route.c                 |   14 +-
 sys/net/route.h                 |    5 +-
 sys/net/rtsock.c                |    4 +-
 sys/netinet/icmp6.h             |    2 +
 sys/netinet/igmp.c              |    3 +-
 sys/netinet/in.h                |    5 +-
 sys/netinet/in_gif.c            |    9 +-
 sys/netinet/in_gif.h            |    4 +-
 sys/netinet/in_pcb.c            |    4 +-
 sys/netinet/in_proto.c          |    3 +-
 sys/netinet/ip6.h               |    2 +
 sys/netinet/ip_ecn.c            |    5 +-
 sys/netinet/ip_ecn.h            |   10 +-
 sys/netinet/ip_icmp.c           |    4 +-
 sys/netinet/ip_input.c          |   15 +-
 sys/netinet/ip_mroute.c         |    4 +-
 sys/netinet/ip_output.c         |    3 +-
 sys/netinet/ip_var.h            |    4 +-
 sys/netinet/raw_ip.c            |   15 +-
 sys/netinet/tcp_debug.h         |    6 +-
 sys/netinet/tcp_input.c         |   58 +++-
 sys/netinet/tcp_output.c        |   16 +-
 sys/netinet/tcp_subr.c          |  191 +++++++++++-
 sys/netinet/tcp_timer.c         |    6 +-
 sys/netinet/tcp_usrreq.c        |    5 +-
 sys/netinet/tcp_var.h           |   19 +-
 sys/netinet/udp_usrreq.c        |   13 +-
 sys/netinet6/IMPLEMENTATION     |    4 +-
 sys/netinet6/Makefile           |    4 +-
 sys/netinet6/TODO               |    6 +-
 sys/netinet6/ah.h               |    8 +
 sys/netinet6/ah_core.c          |   20 +-
 sys/netinet6/ah_input.c         |   11 +-
 sys/netinet6/ah_output.c        |    3 +-
 sys/netinet6/dest6.c            |    3 +-
 sys/netinet6/esp.h              |    8 +
 sys/netinet6/frag6.c            |    5 +-
 sys/netinet6/icmp6.c            |  129 +++++++-
 sys/netinet6/icmp6.h            |    9 +-
 sys/netinet6/in6.c              |    7 +-
 sys/netinet6/in6.h              |   34 +-
 sys/netinet6/in6_cksum.c        |   36 +-
 sys/netinet6/in6_gif.c          |    6 +-
 sys/netinet6/in6_gif.h          |    2 +
 sys/netinet6/in6_ifattach.c     |   31 +-
 sys/netinet6/in6_ifattach.h     |    2 +
 sys/netinet6/in6_pcb.c          |   38 ++-
 sys/netinet6/in6_pcb.h          |    8 +-
 sys/netinet6/in6_prefix.c       |    2 +
 sys/netinet6/in6_proto.c        |   13 +-
 sys/netinet6/in6_systm.h        |   79 -----
 sys/netinet6/in6_var.h          |   12 +-
 sys/netinet6/ip6.h              |    9 +-
 sys/netinet6/ip6_forward.c      |    3 +-
 sys/netinet6/ip6_input.c        |   15 +-
 sys/netinet6/ip6_mroute.c       |   57 ++-
 sys/netinet6/ip6_mroute.h       |    2 +
 sys/netinet6/ip6_output.c       |   18 +-
 sys/netinet6/ip6_var.h          |    6 +-
 sys/netinet6/ip6protosw.h       |    2 +
 sys/netinet6/ipcomp.h           |    8 +
 sys/netinet6/ipcomp_core.c      |    2 +
 sys/netinet6/ipcomp_input.c     |    5 +-
 sys/netinet6/ipcomp_output.c    |    5 +-
 sys/netinet6/ipsec.c            |   41 ++-
 sys/netinet6/ipsec.h            |   12 +
 sys/netinet6/mld6.c             |    9 +-
 sys/netinet6/mld6_var.h         |    2 +
 sys/netinet6/nd6.c              |  117 ++++++-
 sys/netinet6/nd6.h              |    5 +-
 sys/netinet6/nd6_nbr.c          |   40 +-
 sys/netinet6/nd6_rtr.c          |   21 +-
 sys/netinet6/pim6.h             |    2 +
 sys/netinet6/pim6_var.h         |    4 +-
 sys/netinet6/raw_ip6.c          |   15 +-
 sys/netinet6/route6.c           |    2 +
 sys/netinet6/udp6.h             |    2 +
 sys/netinet6/udp6_usrreq.c      |   40 ++-
 sys/netinet6/udp6_var.h         |    2 +
 sys/netkey/key.c                |  567 +++++++++++++++++++++++++++++++++++++++-
 sys/netkey/key.h                |    4 +-
 sys/netkey/key_debug.c          |    7 +-
 sys/netkey/key_debug.h          |    4 +-
 sys/netkey/key_var.h            |    6 +
 sys/netkey/keydb.h              |    2 +
 sys/netkey/keysock.c            |   15 +-
 sys/netkey/keysock.h            |    4 +-
 sys/netkey/keyv2.h              |    8 +-
 sys/nfs/nfs_boot.c              |    4 +-
 sys/nfs/nfs_bootparam.c         |    6 +-
 sys/nfs/nfs_node.c              |    3 +-
 sys/nfs/nfs_socket.c            |   48 +++-
 sys/nfs/nfs_subs.c              |   10 +-
 sys/nfs/nfs_vnops.c             |   16 +-
 sys/nfs/nfsmount.h              |    3 +-
 117 files changed, 2298 insertions(+), 1294 deletions(-)

diffs (truncated from 8225 to 300 lines):

diff -r 4414c7a1236a -r 95673b9dd41b sys/miscfs/umapfs/umap.h
--- a/sys/miscfs/umapfs/umap.h  Mon Aug 02 22:19:11 1999 +0000
+++ b/sys/miscfs/umapfs/umap.h  Mon Aug 02 22:30:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umap.h,v 1.8 1998/03/01 02:21:51 fvdl Exp $    */
+/*     $NetBSD: umap.h,v 1.8.10.1 1999/08/02 22:30:25 thorpej Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -39,22 +39,28 @@
  *     @(#)umap.h      8.4 (Berkeley) 8/20/94
  */
 
+#include <miscfs/genfs/layer.h>
+
 #define MAPFILEENTRIES 64
 #define GMAPFILEENTRIES 16
 #define NOBODY 32767
 #define NULLGROUP 65534
 
 struct umap_args {
-       char            *target;        /* Target of loopback  */
+       struct layer_args la;           /* generic layerfs args. Includes
+                                        * target and export info */
+#define        umap_target     la.target
+#define        umap_export     la.export
        int             nentries;       /* # of entries in user map array */
        int             gnentries;      /* # of entries in group map array */
        u_long          (*mapdata)[2];  /* pointer to array of user mappings */
        u_long          (*gmapdata)[2]; /* pointer to array of group mappings */
 };
 
+#ifdef _KERNEL
+
 struct umap_mount {
-       struct mount    *umapm_vfs;
-       struct vnode    *umapm_rootvp;  /* Reference to root umap_node */
+       struct layer_mount lm;          
        int             info_nentries;  /* number of uid mappings */
        int             info_gnentries; /* number of gid mappings */
        u_long          info_mapdata[MAPFILEENTRIES][2]; /* mapping data for 
@@ -62,27 +68,39 @@
        u_long          info_gmapdata[GMAPFILEENTRIES][2]; /*mapping data for 
            group mapping in ficus */
 };
+#define        umapm_vfs               lm.layerm_vfs
+#define        umapm_rootvp            lm.layerm_rootvp
+#define        umapm_export            lm.layerm_export
+#define        umapm_flags             lm.layerm_flags
+#define        umapm_size              lm.layerm_size
+#define        umapm_tag               lm.layerm_tag
+#define        umapm_bypass            lm.layerm_bypass
+#define        umapm_alloc             lm.layerm_alloc
+#define        umapm_vnodeop_p         lm.layerm_vnodeop_p
+#define        umapm_node_hashtbl      lm.layerm_node_hashtbl
+#define        umapm_node_hash         lm.layerm_node_hash
+#define        umapm_hashlock          lm.layerm_hashlock
 
-#ifdef _KERNEL
 /*
  * A cache of vnode references
  */
 struct umap_node {
-       LIST_ENTRY(umap_node) umap_hash;        /* Hash list */
-       struct vnode    *umap_lowervp;  /* Aliased vnode - VREFed once */
-       struct vnode    *umap_vnode;    /* Back pointer to vnode/umap_node */
+       struct  layer_node      ln;
 };
 
-extern int umap_node_create __P((struct mount *mp, struct vnode *target, struct vnode **vpp));
-extern u_long umap_reverse_findid __P((u_long id, u_long map[][2], int nentries));
-extern void umap_mapids __P((struct mount *v_mount, struct ucred *credp));
+u_long umap_reverse_findid __P((u_long id, u_long map[][2], int nentries));
+void umap_mapids __P((struct mount *v_mount, struct ucred *credp));
+
+#define        umap_hash       ln.layer_hash
+#define        umap_lowervp    ln.layer_lowervp
+#define        umap_vnode      ln.layer_vnode
+#define        umap_flags      ln.layer_flags
 
 #define        MOUNTTOUMAPMOUNT(mp) ((struct umap_mount *)((mp)->mnt_data))
 #define        VTOUMAP(vp) ((struct umap_node *)(vp)->v_data)
 #define UMAPTOV(xp) ((xp)->umap_vnode)
 #ifdef UMAPFS_DIAGNOSTIC
-extern struct vnode *umap_checkvp __P((struct vnode *vp, char *fil, int lno));
-#define        UMAPVPTOLOWERVP(vp) umap_checkvp((vp), __FILE__, __LINE__)
+#define        UMAPVPTOLOWERVP(vp) layer_checkvp((vp), __FILE__, __LINE__)
 #else
 #define        UMAPVPTOLOWERVP(vp) (VTOUMAP(vp)->umap_lowervp)
 #endif
@@ -90,6 +108,8 @@
 extern int (**umap_vnodeop_p) __P((void *));
 extern struct vfsops umapfs_vfsops;
 
-void umapfs_init __P((void));
+int     umap_bypass     __P((void *));
+
+#define NUMAPNODECACHE 16
 
 #endif /* _KERNEL */
diff -r 4414c7a1236a -r 95673b9dd41b sys/miscfs/umapfs/umap_subr.c
--- a/sys/miscfs/umapfs/umap_subr.c     Mon Aug 02 22:19:11 1999 +0000
+++ b/sys/miscfs/umapfs/umap_subr.c     Mon Aug 02 22:30:25 1999 +0000
@@ -1,6 +1,38 @@
-/*     $NetBSD: umap_subr.c,v 1.14 1999/03/19 21:46:25 perseant Exp $  */
+/*     $NetBSD: umap_subr.c,v 1.14.4.1 1999/08/02 22:30:25 thorpej Exp $       */
 
 /*
+ * Copyright (c) 1999 National Aeronautics & Space Administration
+ * All rights reserved.
+ *
+ * This software was written by William Studenmund of the
+ * Numerical Aerospace Similation Facility, NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the the name of the National Aeronautics & Space Administration
+ *    nor the names of its contributors may be used to endorse or promote
+ *    products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NATIONAL AERONAUTICS & SPACE ADMINISTRATION
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ADMINISTRATION OR CONTRIB-
+ * UTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
  * Copyright (c) 1992, 1993, 1995
  *     The Regents of the University of California.  All rights reserved.
  *
@@ -51,45 +83,15 @@
 #include <miscfs/specfs/specdev.h>
 #include <miscfs/umapfs/umap.h>
 
-#define LOG2_SIZEVNODE 7               /* log2(sizeof struct vnode) */
-#define        NUMAPNODECACHE 16
-
-/*
- * Null layer cache:
- * Each cache entry holds a reference to the target vnode
- * along with a pointer to the alias vnode.  When an
- * entry is added the target vnode is VREF'd.  When the
- * alias is removed the target vnode is vrele'd.
- */
-
-#define        UMAP_NHASH(vp) \
-       (&umap_node_hashtbl[(((u_long)vp)>>LOG2_SIZEVNODE) & umap_node_hash])
-LIST_HEAD(umap_node_hashhead, umap_node) *umap_node_hashtbl;
-u_long umap_node_hash;
-
-static u_long umap_findid __P((u_long, u_long [][2], int));
-static struct vnode *umap_node_find __P((struct mount *, struct vnode *));
-static int umap_node_alloc __P((struct mount *, struct vnode *,
+u_long umap_findid __P((u_long, u_long [][2], int));
+int umap_node_alloc __P((struct mount *, struct vnode *,
                                struct vnode **));
 
 /*
- * Initialise cache headers
- */
-void
-umapfs_init()
-{
-
-#ifdef UMAPFS_DIAGNOSTIC
-       printf("umapfs_init\n");                /* printed during system boot */
-#endif
-       umap_node_hashtbl = hashinit(NUMAPNODECACHE, M_CACHE, M_WAITOK, &umap_node_hash);
-}
-
-/*
  * umap_findid is called by various routines in umap_vnodeops.c to
  * find a user or group id in a map.
  */
-static u_long
+u_long
 umap_findid(id, map, nentries)
        u_long id;
        u_long map[][2];
@@ -133,269 +135,6 @@
 
 }
 
-/*
- * Return alias for target vnode if already exists, else 0.
- */
-static struct vnode *
-umap_node_find(mp, targetvp)
-       struct mount *mp;
-       struct vnode *targetvp;
-{
-       struct umap_node_hashhead *hd;
-       struct umap_node *a;
-       struct vnode *vp;
-
-#ifdef UMAPFS_DIAGNOSTIC
-       printf("umap_node_find(mp = %p, target = %p)\n", mp, targetvp);
-#endif
-
-       /*
-        * Find hash base, and then search the (two-way) linked
-        * list looking for a umap_node structure which is referencing
-        * the target vnode.  If found, the increment the umap_node
-        * reference count (but NOT the target vnode's VREF counter).
-        */
-       hd = UMAP_NHASH(targetvp);
-loop:
-       for (a = hd->lh_first; a != 0; a = a->umap_hash.le_next) {
-               if (a->umap_lowervp == targetvp &&
-                   a->umap_vnode->v_mount == mp) {
-                       vp = UMAPTOV(a);
-                       /*
-                        * We need vget for the VXLOCK
-                        * stuff, but we don't want to lock
-                        * the lower node.
-                        */
-                       if (vget(vp, 0)) {
-#ifdef UMAPFS_DIAGNOSTIC
-                               printf ("umap_node_find: vget failed.\n");
-#endif
-                               goto loop;
-                       }
-                       return (vp);
-               }
-       }
-
-#ifdef UMAPFS_DIAGNOSTIC
-       printf("umap_node_find(%p, %p): NOT found\n", mp, targetvp);
-#endif
-
-       return (0);
-}
-
-/*
- * Make a new umap_node node.
- * Vp is the alias vnode, lowervp is the target vnode.
- * Maintain a reference to lowervp.
- */
-static int
-umap_node_alloc(mp, lowervp, vpp)
-       struct mount *mp;
-       struct vnode *lowervp;
-       struct vnode **vpp;
-{
-       struct umap_node_hashhead *hd;
-       struct umap_node *xp;
-       struct vnode *vp, *nvp;
-       struct proc *p = curproc;       /* XXX */
-       int error;
-       extern int (**dead_vnodeop_p) __P((void *));
-
-       if ((error = getnewvnode(VT_UMAP, mp, umap_vnodeop_p, &vp)) != 0)
-               return (error);
-       vp->v_type = lowervp->v_type;
-
-       MALLOC(xp, struct umap_node *, sizeof(struct umap_node), M_TEMP,
-           M_WAITOK);
-       if (vp->v_type == VBLK || vp->v_type == VCHR) {
-               MALLOC(vp->v_specinfo, struct specinfo *,
-                   sizeof(struct specinfo), M_VNODE, M_WAITOK);
-               vp->v_rdev = lowervp->v_rdev;
-       }
-
-       vp->v_data = xp;
-       xp->umap_vnode = vp;
-       xp->umap_lowervp = lowervp;
-       /*
-        * Before we insert our new node onto the hash chains,
-        * check to see if someone else has beaten us to it.
-        * (We could have slept in MALLOC.)
-        */
-       if ((nvp = umap_node_find(mp, lowervp)) != NULL) {
-               *vpp = nvp;
-
-               /* free the substructures we've allocated. */
-               FREE(xp, M_TEMP);
-               if (vp->v_type == VBLK || vp->v_type == VCHR)
-                       FREE(vp->v_specinfo, M_VNODE);
-
-               vp->v_type = VBAD;              /* node is discarded */
-               vp->v_op = dead_vnodeop_p;      /* so ops will still work */
-               vrele(vp);                      /* get rid of it. */
-               return (0);
-       }
-
-       /*
-        * XXX if it's a device node, it needs to be checkalias()ed.



Home | Main Index | Thread Index | Old Index