rename nch to avoid name conflict
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Fri, 21 Feb 1986 13:36:33 +0000 (05:36 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Fri, 21 Feb 1986 13:36:33 +0000 (05:36 -0800)
SCCS-vsn: sys/vax/vax/machdep.c 6.25
SCCS-vsn: sys/kern/vfs_lookup.c 6.27
SCCS-vsn: sys/ufs/ffs/ufs_lookup.c 6.27
SCCS-vsn: sys/ufs/ufs/ufs_lookup.c 6.27

usr/src/sys/kern/vfs_lookup.c
usr/src/sys/ufs/ffs/ufs_lookup.c
usr/src/sys/ufs/ufs/ufs_lookup.c
usr/src/sys/vax/vax/machdep.c

index b8ee10a..feec207 100644 (file)
@@ -35,12 +35,12 @@ int dirchk = 0;
 
 union nchash {
        union   nchash *nch_head[2];
 
 union nchash {
        union   nchash *nch_head[2];
-       struct  nch *nch_chain[2];
+       struct  namecache *nch_chain[2];
 } nchash[NCHHASH];
 #define        nch_forw        nch_chain[0]
 #define        nch_back        nch_chain[1]
 
 } nchash[NCHHASH];
 #define        nch_forw        nch_chain[0]
 #define        nch_back        nch_chain[1]
 
-struct nch *nchhead, **nchtail;        /* LRU chain pointers */
+struct namecache *nchhead, **nchtail;  /* LRU chain pointers */
 struct nchstats nchstats;              /* cache effectiveness statistics */
 
 /*
 struct nchstats nchstats;              /* cache effectiveness statistics */
 
 /*
@@ -122,7 +122,7 @@ namei(ndp)
        register char *cp;              /* pointer into pathname argument */
 /* these variables refer to things which must be freed or unlocked */
        register struct inode *dp = 0;  /* the directory we are searching */
        register char *cp;              /* pointer into pathname argument */
 /* these variables refer to things which must be freed or unlocked */
        register struct inode *dp = 0;  /* the directory we are searching */
-       register struct nch *ncp;       /* cache slot for entry */
+       register struct namecache *ncp; /* cache slot for entry */
        register struct fs *fs;         /* file system that directory is in */
        register struct buf *bp = 0;    /* a buffer of directory entries */
        register struct direct *ep;     /* the current directory entry */
        register struct fs *fs;         /* file system that directory is in */
        register struct buf *bp = 0;    /* a buffer of directory entries */
        register struct direct *ep;     /* the current directory entry */
@@ -264,7 +264,7 @@ dirloop2:
                makeentry = 0;
        } else {
                nhp = &nchash[NHASH(hash, dp->i_number, dp->i_dev)];
                makeentry = 0;
        } else {
                nhp = &nchash[NHASH(hash, dp->i_number, dp->i_dev)];
-               for (ncp = nhp->nch_forw; ncp != (struct nch *)nhp;
+               for (ncp = nhp->nch_forw; ncp != (struct namecache *)nhp;
                    ncp = ncp->nc_forw) {
                        if (ncp->nc_ino == dp->i_number &&
                            ncp->nc_dev == dp->i_dev &&
                    ncp = ncp->nc_forw) {
                        if (ncp->nc_ino == dp->i_number &&
                            ncp->nc_dev == dp->i_dev &&
@@ -273,15 +273,15 @@ dirloop2:
                                (unsigned)ncp->nc_nlen))
                                break;
                }
                                (unsigned)ncp->nc_nlen))
                                break;
                }
-               if (ncp == (struct nch *)nhp) {
+               if (ncp == (struct namecache *)nhp) {
                        nchstats.ncs_miss++;
                        ncp = NULL;
                } else {
                        nchstats.ncs_miss++;
                        ncp = NULL;
                } else {
-                       if (ncp->nc_id != ncp->nc_ip->i_id) {
+                       if (ncp->nc_id != ncp->nc_ip->i_id)
                                nchstats.ncs_falsehits++;
                                nchstats.ncs_falsehits++;
-                       } else if (!makeentry) {
+                       else if (!makeentry)
                                nchstats.ncs_badhits++;
                                nchstats.ncs_badhits++;
-                       else {
+                       else {
                                /*
                                 * move this slot to end of LRU
                                 * chain, if not already there
                                /*
                                 * move this slot to end of LRU
                                 * chain, if not already there
@@ -308,9 +308,9 @@ dirloop2:
                                        dp = ncp->nc_ip;
                                if (dp == NULL)
                                        panic("nami: null cache ino");
                                        dp = ncp->nc_ip;
                                if (dp == NULL)
                                        panic("nami: null cache ino");
-                               if (pdp == dp) {
+                               if (pdp == dp)
                                        dp->i_count++;
                                        dp->i_count++;
-                               else if (isdotdot) {
+                               else if (isdotdot) {
                                        IUNLOCK(pdp);
                                        igrab(dp);
                                } else {
                                        IUNLOCK(pdp);
                                        igrab(dp);
                                } else {
@@ -1195,11 +1195,11 @@ out:
 nchinit()
 {
        register union nchash *nchp;
 nchinit()
 {
        register union nchash *nchp;
-       register struct nch *ncp;
+       register struct namecache *ncp;
 
        nchhead = 0;
        nchtail = &nchhead;
 
        nchhead = 0;
        nchtail = &nchhead;
-       for (ncp = nch; ncp < &nch[nchsize]; ncp++) {
+       for (ncp = namecache; ncp < &namecache[nchsize]; ncp++) {
                ncp->nc_forw = ncp;                     /* hash chain */
                ncp->nc_back = ncp;
                ncp->nc_nxt = NULL;                     /* lru chain */
                ncp->nc_forw = ncp;                     /* hash chain */
                ncp->nc_back = ncp;
                ncp->nc_nxt = NULL;                     /* lru chain */
@@ -1225,7 +1225,7 @@ nchinit()
 nchinval(dev)
        register dev_t dev;
 {
 nchinval(dev)
        register dev_t dev;
 {
-       register struct nch *ncp, *nxtcp;
+       register struct namecache *ncp, *nxtcp;
 
        for (ncp = nchhead; ncp; ncp = nxtcp) {
                nxtcp = ncp->nc_nxt;
 
        for (ncp = nchhead; ncp; ncp = nxtcp) {
                nxtcp = ncp->nc_nxt;
@@ -1262,8 +1262,8 @@ nchinval(dev)
  */
 cacheinvalall()
 {
  */
 cacheinvalall()
 {
-       register struct nch *ncp;
+       register struct namecache *ncp;
 
 
-       for (ncp = nch; ncp < &nch[nchsize]; ncp++)
+       for (ncp = namecache; ncp < &namecache[nchsize]; ncp++)
                ncp->nc_id = 0;
 }
                ncp->nc_id = 0;
 }
index 756772c..5acc45e 100644 (file)
@@ -35,12 +35,12 @@ int dirchk = 0;
 
 union nchash {
        union   nchash *nch_head[2];
 
 union nchash {
        union   nchash *nch_head[2];
-       struct  nch *nch_chain[2];
+       struct  namecache *nch_chain[2];
 } nchash[NCHHASH];
 #define        nch_forw        nch_chain[0]
 #define        nch_back        nch_chain[1]
 
 } nchash[NCHHASH];
 #define        nch_forw        nch_chain[0]
 #define        nch_back        nch_chain[1]
 
-struct nch *nchhead, **nchtail;        /* LRU chain pointers */
+struct namecache *nchhead, **nchtail;  /* LRU chain pointers */
 struct nchstats nchstats;              /* cache effectiveness statistics */
 
 /*
 struct nchstats nchstats;              /* cache effectiveness statistics */
 
 /*
@@ -122,7 +122,7 @@ namei(ndp)
        register char *cp;              /* pointer into pathname argument */
 /* these variables refer to things which must be freed or unlocked */
        register struct inode *dp = 0;  /* the directory we are searching */
        register char *cp;              /* pointer into pathname argument */
 /* these variables refer to things which must be freed or unlocked */
        register struct inode *dp = 0;  /* the directory we are searching */
-       register struct nch *ncp;       /* cache slot for entry */
+       register struct namecache *ncp; /* cache slot for entry */
        register struct fs *fs;         /* file system that directory is in */
        register struct buf *bp = 0;    /* a buffer of directory entries */
        register struct direct *ep;     /* the current directory entry */
        register struct fs *fs;         /* file system that directory is in */
        register struct buf *bp = 0;    /* a buffer of directory entries */
        register struct direct *ep;     /* the current directory entry */
@@ -264,7 +264,7 @@ dirloop2:
                makeentry = 0;
        } else {
                nhp = &nchash[NHASH(hash, dp->i_number, dp->i_dev)];
                makeentry = 0;
        } else {
                nhp = &nchash[NHASH(hash, dp->i_number, dp->i_dev)];
-               for (ncp = nhp->nch_forw; ncp != (struct nch *)nhp;
+               for (ncp = nhp->nch_forw; ncp != (struct namecache *)nhp;
                    ncp = ncp->nc_forw) {
                        if (ncp->nc_ino == dp->i_number &&
                            ncp->nc_dev == dp->i_dev &&
                    ncp = ncp->nc_forw) {
                        if (ncp->nc_ino == dp->i_number &&
                            ncp->nc_dev == dp->i_dev &&
@@ -273,15 +273,15 @@ dirloop2:
                                (unsigned)ncp->nc_nlen))
                                break;
                }
                                (unsigned)ncp->nc_nlen))
                                break;
                }
-               if (ncp == (struct nch *)nhp) {
+               if (ncp == (struct namecache *)nhp) {
                        nchstats.ncs_miss++;
                        ncp = NULL;
                } else {
                        nchstats.ncs_miss++;
                        ncp = NULL;
                } else {
-                       if (ncp->nc_id != ncp->nc_ip->i_id) {
+                       if (ncp->nc_id != ncp->nc_ip->i_id)
                                nchstats.ncs_falsehits++;
                                nchstats.ncs_falsehits++;
-                       } else if (!makeentry) {
+                       else if (!makeentry)
                                nchstats.ncs_badhits++;
                                nchstats.ncs_badhits++;
-                       else {
+                       else {
                                /*
                                 * move this slot to end of LRU
                                 * chain, if not already there
                                /*
                                 * move this slot to end of LRU
                                 * chain, if not already there
@@ -308,9 +308,9 @@ dirloop2:
                                        dp = ncp->nc_ip;
                                if (dp == NULL)
                                        panic("nami: null cache ino");
                                        dp = ncp->nc_ip;
                                if (dp == NULL)
                                        panic("nami: null cache ino");
-                               if (pdp == dp) {
+                               if (pdp == dp)
                                        dp->i_count++;
                                        dp->i_count++;
-                               else if (isdotdot) {
+                               else if (isdotdot) {
                                        IUNLOCK(pdp);
                                        igrab(dp);
                                } else {
                                        IUNLOCK(pdp);
                                        igrab(dp);
                                } else {
@@ -1195,11 +1195,11 @@ out:
 nchinit()
 {
        register union nchash *nchp;
 nchinit()
 {
        register union nchash *nchp;
-       register struct nch *ncp;
+       register struct namecache *ncp;
 
        nchhead = 0;
        nchtail = &nchhead;
 
        nchhead = 0;
        nchtail = &nchhead;
-       for (ncp = nch; ncp < &nch[nchsize]; ncp++) {
+       for (ncp = namecache; ncp < &namecache[nchsize]; ncp++) {
                ncp->nc_forw = ncp;                     /* hash chain */
                ncp->nc_back = ncp;
                ncp->nc_nxt = NULL;                     /* lru chain */
                ncp->nc_forw = ncp;                     /* hash chain */
                ncp->nc_back = ncp;
                ncp->nc_nxt = NULL;                     /* lru chain */
@@ -1225,7 +1225,7 @@ nchinit()
 nchinval(dev)
        register dev_t dev;
 {
 nchinval(dev)
        register dev_t dev;
 {
-       register struct nch *ncp, *nxtcp;
+       register struct namecache *ncp, *nxtcp;
 
        for (ncp = nchhead; ncp; ncp = nxtcp) {
                nxtcp = ncp->nc_nxt;
 
        for (ncp = nchhead; ncp; ncp = nxtcp) {
                nxtcp = ncp->nc_nxt;
@@ -1262,8 +1262,8 @@ nchinval(dev)
  */
 cacheinvalall()
 {
  */
 cacheinvalall()
 {
-       register struct nch *ncp;
+       register struct namecache *ncp;
 
 
-       for (ncp = nch; ncp < &nch[nchsize]; ncp++)
+       for (ncp = namecache; ncp < &namecache[nchsize]; ncp++)
                ncp->nc_id = 0;
 }
                ncp->nc_id = 0;
 }
index 756772c..5acc45e 100644 (file)
@@ -35,12 +35,12 @@ int dirchk = 0;
 
 union nchash {
        union   nchash *nch_head[2];
 
 union nchash {
        union   nchash *nch_head[2];
-       struct  nch *nch_chain[2];
+       struct  namecache *nch_chain[2];
 } nchash[NCHHASH];
 #define        nch_forw        nch_chain[0]
 #define        nch_back        nch_chain[1]
 
 } nchash[NCHHASH];
 #define        nch_forw        nch_chain[0]
 #define        nch_back        nch_chain[1]
 
-struct nch *nchhead, **nchtail;        /* LRU chain pointers */
+struct namecache *nchhead, **nchtail;  /* LRU chain pointers */
 struct nchstats nchstats;              /* cache effectiveness statistics */
 
 /*
 struct nchstats nchstats;              /* cache effectiveness statistics */
 
 /*
@@ -122,7 +122,7 @@ namei(ndp)
        register char *cp;              /* pointer into pathname argument */
 /* these variables refer to things which must be freed or unlocked */
        register struct inode *dp = 0;  /* the directory we are searching */
        register char *cp;              /* pointer into pathname argument */
 /* these variables refer to things which must be freed or unlocked */
        register struct inode *dp = 0;  /* the directory we are searching */
-       register struct nch *ncp;       /* cache slot for entry */
+       register struct namecache *ncp; /* cache slot for entry */
        register struct fs *fs;         /* file system that directory is in */
        register struct buf *bp = 0;    /* a buffer of directory entries */
        register struct direct *ep;     /* the current directory entry */
        register struct fs *fs;         /* file system that directory is in */
        register struct buf *bp = 0;    /* a buffer of directory entries */
        register struct direct *ep;     /* the current directory entry */
@@ -264,7 +264,7 @@ dirloop2:
                makeentry = 0;
        } else {
                nhp = &nchash[NHASH(hash, dp->i_number, dp->i_dev)];
                makeentry = 0;
        } else {
                nhp = &nchash[NHASH(hash, dp->i_number, dp->i_dev)];
-               for (ncp = nhp->nch_forw; ncp != (struct nch *)nhp;
+               for (ncp = nhp->nch_forw; ncp != (struct namecache *)nhp;
                    ncp = ncp->nc_forw) {
                        if (ncp->nc_ino == dp->i_number &&
                            ncp->nc_dev == dp->i_dev &&
                    ncp = ncp->nc_forw) {
                        if (ncp->nc_ino == dp->i_number &&
                            ncp->nc_dev == dp->i_dev &&
@@ -273,15 +273,15 @@ dirloop2:
                                (unsigned)ncp->nc_nlen))
                                break;
                }
                                (unsigned)ncp->nc_nlen))
                                break;
                }
-               if (ncp == (struct nch *)nhp) {
+               if (ncp == (struct namecache *)nhp) {
                        nchstats.ncs_miss++;
                        ncp = NULL;
                } else {
                        nchstats.ncs_miss++;
                        ncp = NULL;
                } else {
-                       if (ncp->nc_id != ncp->nc_ip->i_id) {
+                       if (ncp->nc_id != ncp->nc_ip->i_id)
                                nchstats.ncs_falsehits++;
                                nchstats.ncs_falsehits++;
-                       } else if (!makeentry) {
+                       else if (!makeentry)
                                nchstats.ncs_badhits++;
                                nchstats.ncs_badhits++;
-                       else {
+                       else {
                                /*
                                 * move this slot to end of LRU
                                 * chain, if not already there
                                /*
                                 * move this slot to end of LRU
                                 * chain, if not already there
@@ -308,9 +308,9 @@ dirloop2:
                                        dp = ncp->nc_ip;
                                if (dp == NULL)
                                        panic("nami: null cache ino");
                                        dp = ncp->nc_ip;
                                if (dp == NULL)
                                        panic("nami: null cache ino");
-                               if (pdp == dp) {
+                               if (pdp == dp)
                                        dp->i_count++;
                                        dp->i_count++;
-                               else if (isdotdot) {
+                               else if (isdotdot) {
                                        IUNLOCK(pdp);
                                        igrab(dp);
                                } else {
                                        IUNLOCK(pdp);
                                        igrab(dp);
                                } else {
@@ -1195,11 +1195,11 @@ out:
 nchinit()
 {
        register union nchash *nchp;
 nchinit()
 {
        register union nchash *nchp;
-       register struct nch *ncp;
+       register struct namecache *ncp;
 
        nchhead = 0;
        nchtail = &nchhead;
 
        nchhead = 0;
        nchtail = &nchhead;
-       for (ncp = nch; ncp < &nch[nchsize]; ncp++) {
+       for (ncp = namecache; ncp < &namecache[nchsize]; ncp++) {
                ncp->nc_forw = ncp;                     /* hash chain */
                ncp->nc_back = ncp;
                ncp->nc_nxt = NULL;                     /* lru chain */
                ncp->nc_forw = ncp;                     /* hash chain */
                ncp->nc_back = ncp;
                ncp->nc_nxt = NULL;                     /* lru chain */
@@ -1225,7 +1225,7 @@ nchinit()
 nchinval(dev)
        register dev_t dev;
 {
 nchinval(dev)
        register dev_t dev;
 {
-       register struct nch *ncp, *nxtcp;
+       register struct namecache *ncp, *nxtcp;
 
        for (ncp = nchhead; ncp; ncp = nxtcp) {
                nxtcp = ncp->nc_nxt;
 
        for (ncp = nchhead; ncp; ncp = nxtcp) {
                nxtcp = ncp->nc_nxt;
@@ -1262,8 +1262,8 @@ nchinval(dev)
  */
 cacheinvalall()
 {
  */
 cacheinvalall()
 {
-       register struct nch *ncp;
+       register struct namecache *ncp;
 
 
-       for (ncp = nch; ncp < &nch[nchsize]; ncp++)
+       for (ncp = namecache; ncp < &namecache[nchsize]; ncp++)
                ncp->nc_id = 0;
 }
                ncp->nc_id = 0;
 }
index 8969f42..46dc14d 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)machdep.c   6.24 (Berkeley) %G%
+ *     @(#)machdep.c   6.25 (Berkeley) %G%
  */
 
 #include "reg.h"
  */
 
 #include "reg.h"
@@ -110,7 +110,7 @@ startup(firstaddr)
        valloc(argmap, struct map, ARGMAPSIZE);
        valloc(kernelmap, struct map, nproc);
        valloc(mbmap, struct map, nmbclusters/4);
        valloc(argmap, struct map, ARGMAPSIZE);
        valloc(kernelmap, struct map, nproc);
        valloc(mbmap, struct map, nmbclusters/4);
-       valloc(nch, struct nch, nchsize);
+       valloc(namecache, struct namecache, nchsize);
 #ifdef QUOTA
        valloclim(quota, struct quota, nquota, quotaNQUOTA);
        valloclim(dquot, struct dquot, ndquot, dquotNDQUOT);
 #ifdef QUOTA
        valloclim(quota, struct quota, nquota, quotaNQUOTA);
        valloclim(dquot, struct dquot, ndquot, dquotNDQUOT);