changes for 4.4BSD-Lite requested by USL
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 24 Sep 1993 10:37:46 +0000 (02:37 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 24 Sep 1993 10:37:46 +0000 (02:37 -0800)
SCCS-vsn: bin/ps/keyword.c 8.3
SCCS-vsn: bin/ps/nlist.c 8.2
SCCS-vsn: bin/ps/print.c 8.3
SCCS-vsn: bin/ps/ps.c 8.2
SCCS-vsn: lib/libkvm/kvm_proc.c 8.3
SCCS-vsn: sbin/clri/clri.c 8.2
SCCS-vsn: sbin/dump/traverse.c 8.2
SCCS-vsn: sbin/fsck/inode.c 8.2
SCCS-vsn: sbin/fsdb/fsdb.c 8.2
SCCS-vsn: sbin/newfs/mkfs.c 8.2
SCCS-vsn: sbin/quotacheck/quotacheck.c 8.2
SCCS-vsn: usr.bin/gcore/gcore.c 8.2
SCCS-vsn: usr.bin/systat/pigs.c 8.2
SCCS-vsn: usr.bin/w/proc_compare.c 8.2
SCCS-vsn: usr.sbin/mkproto/mkproto.c 8.2
SCCS-vsn: usr.sbin/pstat/pstat.c 8.2
SCCS-vsn: usr.sbin/quot/quot.c 8.2

17 files changed:
usr/src/bin/ps/keyword.c
usr/src/bin/ps/nlist.c
usr/src/bin/ps/print.c
usr/src/bin/ps/ps.c
usr/src/lib/libkvm/kvm_proc.c
usr/src/sbin/clri/clri.c
usr/src/sbin/dump/traverse.c
usr/src/sbin/fsck/inode.c
usr/src/sbin/fsdb/fsdb.c
usr/src/sbin/newfs/mkfs.c
usr/src/sbin/quotacheck/quotacheck.c
usr/src/usr.bin/gcore/gcore.c
usr/src/usr.bin/systat/pigs.c
usr/src/usr.bin/w/proc_compare.c
usr/src/usr.sbin/mkproto/mkproto.c
usr/src/usr.sbin/pstat/pstat.c
usr/src/usr.sbin/quot/quot.c

index 5ff4edc..6e36a95 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)keyword.c  8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)keyword.c  8.3 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -23,7 +23,7 @@ static char sccsid[] = "@(#)keyword.c 8.2 (Berkeley) %G%";
 
 #include "ps.h"
 
 
 #include "ps.h"
 
-#ifdef SPPWAIT
+#ifdef P_PPWAIT
 #define NEWVM
 #endif
 
 #define NEWVM
 #endif
 
@@ -106,7 +106,7 @@ VAR var[] = {
        {"re", "RE", NULL, 0, pvar, 3, POFF(p_swtime), ULONG, "d"},
        {"rgid", "RGID", NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_rgid),
                ULONG, UIDFMT},
        {"re", "RE", NULL, 0, pvar, 3, POFF(p_swtime), ULONG, "d"},
        {"rgid", "RGID", NULL, 0, evar, UIDLEN, EOFF(e_pcred.p_rgid),
                ULONG, UIDFMT},
-       {"rlink", "RLINK", NULL, 0, pvar, 8, POFF(p_rlink), KPTR, "x"},
+       {"rlink", "RLINK", NULL, 0, pvar, 8, POFF(p_back), KPTR, "x"},
        {"rss", "RSS", NULL, 0, p_rssize, 4},
        {"rssize", "", "rsz"},
        {"rsz", "RSZ", NULL, 0, rssize, 4},
        {"rss", "RSS", NULL, 0, p_rssize, 4},
        {"rssize", "", "rsz"},
        {"rsz", "RSZ", NULL, 0, rssize, 4},
index 7ae87e0..ef5d348 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)nlist.c    8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)nlist.c    8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -23,7 +23,7 @@ static char sccsid[] = "@(#)nlist.c   8.1 (Berkeley) %G%";
 
 #include "ps.h"
 
 
 #include "ps.h"
 
-#ifdef SPPWAIT
+#ifdef P_PPWAIT
 #define NEWVM
 #endif
 
 #define NEWVM
 #endif
 
index c9173ff..d0e28b0 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)print.c    8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)print.c    8.3 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -15,7 +15,7 @@ static char sccsid[] = "@(#)print.c   8.2 (Berkeley) %G%";
 #include <sys/proc.h>
 #include <sys/stat.h>
 
 #include <sys/proc.h>
 #include <sys/stat.h>
 
-#ifdef SPPWAIT
+#ifdef P_PPWAIT
 #define NEWVM
 #endif
 
 #define NEWVM
 #endif
 
@@ -121,9 +121,9 @@ logname(k, ve)
        v = ve->var;
 #ifndef NEWVM
        (void)printf("%-*s", v->width, KI_PROC(k)->p_logname);
        v = ve->var;
 #ifndef NEWVM
        (void)printf("%-*s", v->width, KI_PROC(k)->p_logname);
-#else /* NEWVM */
+#else
        (void)printf("%-*s", v->width, KI_EPROC(k)->e_login);
        (void)printf("%-*s", v->width, KI_EPROC(k)->e_login);
-#endif /* NEWVM */
+#endif
 }
 
 void
 }
 
 void
@@ -149,7 +149,7 @@ state(k, ve)
                break;
 
        case SSLEEP:
                break;
 
        case SSLEEP:
-               if (flag & SSINTR)      /* interuptable (long) */
+               if (flag & P_SINTR)     /* interuptable (long) */
                        *cp = p->p_slptime >= MAXSLP ? 'I' : 'S';
                else
                        *cp = 'D';
                        *cp = p->p_slptime >= MAXSLP ? 'I' : 'S';
                else
                        *cp = 'D';
@@ -168,7 +168,7 @@ state(k, ve)
                *cp = '?';
        }
        cp++;
                *cp = '?';
        }
        cp++;
-       if (flag & SLOAD) {
+       if (flag & P_INMEM) {
 #ifndef NEWVM
                if (p->p_rssize > p->p_maxrss)
                        *cp++ = '>';
 #ifndef NEWVM
                if (p->p_rssize > p->p_maxrss)
                        *cp++ = '>';
@@ -185,25 +185,25 @@ state(k, ve)
        else if (flag & SSEQL)
                *cp++ = 'S';
 #endif
        else if (flag & SSEQL)
                *cp++ = 'S';
 #endif
-       if (flag & STRC)
+       if (flag & P_TRACED)
                *cp++ = 'X';
                *cp++ = 'X';
-       if (flag & SWEXIT && p->p_stat != SZOMB)
+       if (flag & P_WEXIT && p->p_stat != SZOMB)
                *cp++ = 'E';
 #ifdef NEWVM
                *cp++ = 'E';
 #ifdef NEWVM
-       if (flag & SPPWAIT)
+       if (flag & P_PPWAIT)
 #else
        if (flag & SVFORK)
 #endif
                *cp++ = 'V';
 #ifdef NEWVM
 #else
        if (flag & SVFORK)
 #endif
                *cp++ = 'V';
 #ifdef NEWVM
-       if (flag & (SSYS|SLOCK|SKEEP|SPHYSIO))
+       if (flag & (P_SYSTEM | P_NOSWAP | P_PHYSIO))
 #else
        if (flag & (SSYS|SLOCK|SULOCK|SKEEP|SPHYSIO))
 #endif
                *cp++ = 'L';
        if (KI_EPROC(k)->e_flag & EPROC_SLEADER)
                *cp++ = 's';
 #else
        if (flag & (SSYS|SLOCK|SULOCK|SKEEP|SPHYSIO))
 #endif
                *cp++ = 'L';
        if (KI_EPROC(k)->e_flag & EPROC_SLEADER)
                *cp++ = 's';
-       if ((flag & SCTTY) && KI_EPROC(k)->e_pgid == KI_EPROC(k)->e_tpgid)
+       if ((flag & P_CONTROLT) && KI_EPROC(k)->e_pgid == KI_EPROC(k)->e_tpgid)
                *cp++ = '+';
        *cp = '\0';
        (void)printf("%-*s", v->width, buf);
                *cp++ = '+';
        *cp = '\0';
        (void)printf("%-*s", v->width, buf);
@@ -393,11 +393,12 @@ vsize(k, ve)
        v = ve->var;
        (void)printf("%*d", v->width,
 #ifndef NEWVM
        v = ve->var;
        (void)printf("%*d", v->width,
 #ifndef NEWVM
-           pgtok(KI_PROC(k)->p_dsize + KI_PROC(k)->p_ssize + KI_EPROC(k)->e_xsize));
-#else /* NEWVM */
+           pgtok(KI_PROC(k)->p_dsize +
+               KI_PROC(k)->p_ssize + KI_EPROC(k)->e_xsize));
+#else
            pgtok(KI_EPROC(k)->e_vm.vm_dsize + KI_EPROC(k)->e_vm.vm_ssize +
                KI_EPROC(k)->e_vm.vm_tsize));
            pgtok(KI_EPROC(k)->e_vm.vm_dsize + KI_EPROC(k)->e_vm.vm_ssize +
                KI_EPROC(k)->e_vm.vm_tsize));
-#endif /* NEWVM */
+#endif
 }
 
 void
 }
 
 void
@@ -412,10 +413,10 @@ rssize(k, ve)
        (void)printf("%*d", v->width,
            pgtok(KI_PROC(k)->p_rssize + (KI_EPROC(k)->e_xccount ?
            (KI_EPROC(k)->e_xrssize / KI_EPROC(k)->e_xccount) : 0)));
        (void)printf("%*d", v->width,
            pgtok(KI_PROC(k)->p_rssize + (KI_EPROC(k)->e_xccount ?
            (KI_EPROC(k)->e_xrssize / KI_EPROC(k)->e_xccount) : 0)));
-#else /* NEWVM */
+#else
        /* XXX don't have info about shared */
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_rssize));
        /* XXX don't have info about shared */
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_rssize));
-#endif /* NEWVM */
+#endif
 }
 
 void
 }
 
 void
@@ -428,9 +429,9 @@ p_rssize(k, ve)             /* doesn't account for text */
        v = ve->var;
 #ifndef NEWVM
        (void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_rssize));
        v = ve->var;
 #ifndef NEWVM
        (void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_rssize));
-#else /* NEWVM */
+#else
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_rssize));
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_rssize));
-#endif /* NEWVM */
+#endif
 }
 
 void
 }
 
 void
@@ -492,7 +493,7 @@ getpcpu(k)
 #define        fxtofl(fixpt)   ((double)(fixpt) / fscale)
 
        /* XXX - I don't like this */
 #define        fxtofl(fixpt)   ((double)(fixpt) / fscale)
 
        /* XXX - I don't like this */
-       if (p->p_swtime == 0 || (p->p_flag & SLOAD) == 0)
+       if (p->p_swtime == 0 || (p->p_flag & P_INMEM) == 0)
                return (0.0);
        if (rawcpu)
                return (100.0 * fxtofl(p->p_pctcpu));
                return (0.0);
        if (rawcpu)
                return (100.0 * fxtofl(p->p_pctcpu));
@@ -529,19 +530,19 @@ getpmem(k)
 
        p = KI_PROC(k);
        e = KI_EPROC(k);
 
        p = KI_PROC(k);
        e = KI_EPROC(k);
-       if ((p->p_flag & SLOAD) == 0)
+       if ((p->p_flag & P_INMEM) == 0)
                return (0.0);
 #ifndef NEWVM
        szptudot = UPAGES + clrnd(ctopt(p->p_dsize + p->p_ssize + e->e_xsize));
        fracmem = ((float)p->p_rssize + szptudot)/CLSIZE/mempages;
        if (p->p_textp && e->e_xccount)
                fracmem += ((float)e->e_xrssize)/CLSIZE/e->e_xccount/mempages;
                return (0.0);
 #ifndef NEWVM
        szptudot = UPAGES + clrnd(ctopt(p->p_dsize + p->p_ssize + e->e_xsize));
        fracmem = ((float)p->p_rssize + szptudot)/CLSIZE/mempages;
        if (p->p_textp && e->e_xccount)
                fracmem += ((float)e->e_xrssize)/CLSIZE/e->e_xccount/mempages;
-#else /* NEWVM */
+#else
        /* XXX want pmap ptpages, segtab, etc. (per architecture) */
        szptudot = UPAGES;
        /* XXX don't have info about shared */
        fracmem = ((float)e->e_vm.vm_rssize + szptudot)/CLSIZE/mempages;
        /* XXX want pmap ptpages, segtab, etc. (per architecture) */
        szptudot = UPAGES;
        /* XXX don't have info about shared */
        fracmem = ((float)e->e_vm.vm_rssize + szptudot)/CLSIZE/mempages;
-#endif /* NEWVM */
+#endif
        return (100.0 * fracmem);
 }
 
        return (100.0 * fracmem);
 }
 
@@ -580,7 +581,7 @@ maxrss(k, ve)
        if (KI_PROC(k)->p_maxrss != (RLIM_INFINITY/NBPG))
                (void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_maxrss));
        else
        if (KI_PROC(k)->p_maxrss != (RLIM_INFINITY/NBPG))
                (void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_maxrss));
        else
-#endif /* NEWVM */
+#endif
                (void)printf("%*s", v->width, "-");
 }
 
                (void)printf("%*s", v->width, "-");
 }
 
@@ -594,9 +595,9 @@ tsize(k, ve)
        v = ve->var;
 #ifndef NEWVM
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_xsize));
        v = ve->var;
 #ifndef NEWVM
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_xsize));
-#else /* NEWVM */
+#else
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_tsize));
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_tsize));
-#endif /* NEWVM */
+#endif
 }
 
 #ifndef NEWVM
 }
 
 #ifndef NEWVM
@@ -610,7 +611,7 @@ trss(k, ve)
        v = ve->var;
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_xrssize));
 }
        v = ve->var;
        (void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_xrssize));
 }
-#endif /* NEWVM */
+#endif
 
 /*
  * Generic output routines.  Print fields from various prototype
 
 /*
  * Generic output routines.  Print fields from various prototype
index 931f101..700a84e 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)ps.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)ps.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)ps.c      8.1 (Berkeley) %G%";
 
 #include "ps.h"
 
 
 #include "ps.h"
 
-#ifdef SPPWAIT
+#ifdef P_PPWAIT
 #define NEWVM
 #endif
 
 #define NEWVM
 #endif
 
@@ -288,7 +288,7 @@ main(argc, argv)
         */
        for (i = lineno = 0; i < nentries; i++) {
                if (xflg == 0 && (KI_EPROC(&kinfo[i])->e_tdev == NODEV ||
         */
        for (i = lineno = 0; i < nentries; i++) {
                if (xflg == 0 && (KI_EPROC(&kinfo[i])->e_tdev == NODEV ||
-                   (KI_PROC(&kinfo[i])->p_flag & SCTTY ) == 0))
+                   (KI_PROC(&kinfo[i])->p_flag & P_CONTROLT ) == 0))
                        continue;
                for (vent = vhead; vent; vent = vent->next) {
                        (vent->var->oproc)(&kinfo[i], vent);
                        continue;
                for (vent = vhead; vent; vent = vent->next) {
                        (vent->var->oproc)(&kinfo[i], vent);
index aa916ba..e8e39fc 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)kvm_proc.c 8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 /*
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -216,7 +216,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
                                pgrp.pg_session);
                        return (-1);
                }
                                pgrp.pg_session);
                        return (-1);
                }
-               if ((proc.p_flag & SCTTY) && sess.s_ttyp != NULL) {
+               if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) {
                        if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) {
                                _kvm_err(kd, kd->program,
                                         "can't read tty at %x", sess.s_ttyp);
                        if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) {
                                _kvm_err(kd, kd->program,
                                         "can't read tty at %x", sess.s_ttyp);
@@ -265,13 +265,13 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
                        break;
 
                case KERN_PROC_TTY:
                        break;
 
                case KERN_PROC_TTY:
-                       if ((proc.p_flag&SCTTY) == 0 || 
+                       if ((proc.p_flag & P_CONTROLT) == 0 || 
                             eproc.e_tdev != (dev_t)arg)
                                continue;
                        break;
                }
                             eproc.e_tdev != (dev_t)arg)
                                continue;
                        break;
                }
-               bcopy((char *)&proc, (char *)&bp->kp_proc, sizeof(proc));
-               bcopy((char *)&eproc, (char *)&bp->kp_eproc, sizeof(eproc));
+               bcopy(&proc, &bp->kp_proc, sizeof(proc));
+               bcopy(&eproc, &bp->kp_eproc, sizeof(eproc));
                ++bp;
                ++cnt;
        }
                ++bp;
                ++cnt;
        }
index b23f2ac..89e7381 100644 (file)
@@ -15,7 +15,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)clri.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)clri.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -84,9 +84,9 @@ main(argc, argv)
                (void)printf("clearing %d\n", inonum);
 
                /* read in the appropriate block. */
                (void)printf("clearing %d\n", inonum);
 
                /* read in the appropriate block. */
-               offset = itod(sbp, inonum);     /* inode to fs block */
-               offset = fsbtodb(sbp, offset);  /* fs block to disk block */
-               offset *= DEV_BSIZE;            /* disk block to disk bytes */
+               offset = ino_to_fsba(sbp, inonum);      /* inode to fs blk */
+               offset = fsbtodb(sbp, offset);          /* fs blk disk blk */
+               offset *= DEV_BSIZE;                    /* disk blk to bytes */
 
                /* seek and read the block */
                if (lseek(fd, offset, SEEK_SET) < 0)
 
                /* seek and read the block */
                if (lseek(fd, offset, SEEK_SET) < 0)
@@ -95,7 +95,7 @@ main(argc, argv)
                        err(1, "%s", fs);
 
                /* get the inode within the block. */
                        err(1, "%s", fs);
 
                /* get the inode within the block. */
-               ip = &ibuf[itoo(sbp, inonum)];
+               ip = &ibuf[ino_to_fsbo(sbp, inonum)];
 
                /* clear the inode, and bump the generation count. */
                generation = ip->di_gen + 1;
 
                /* clear the inode, and bump the generation count. */
                generation = ip->di_gen + 1;
index eb47b4e..54515e3 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)traverse.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)traverse.c 8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -506,7 +506,7 @@ getino(inum)
        curino = inum;
        if (inum >= minino && inum < maxino)
                return (&inoblock[inum - minino]);
        curino = inum;
        if (inum >= minino && inum < maxino)
                return (&inoblock[inum - minino]);
-       bread(fsbtodb(sblock, itod(sblock, inum)), (char *)inoblock,
+       bread(fsbtodb(sblock, ino_to_fsba(sblock, inum)), (char *)inoblock,
            (int)sblock->fs_bsize);
        minino = inum - (inum % INOPB(sblock));
        maxino = minino + INOPB(sblock);
            (int)sblock->fs_bsize);
        minino = inum - (inum % INOPB(sblock));
        maxino = minino + INOPB(sblock);
index 20017b3..a7946b9 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)inode.c    8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)inode.c    8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -185,7 +185,7 @@ ginode(inumber)
                errexit("bad inode number %d to ginode\n", inumber);
        if (startinum == 0 ||
            inumber < startinum || inumber >= startinum + INOPB(&sblock)) {
                errexit("bad inode number %d to ginode\n", inumber);
        if (startinum == 0 ||
            inumber < startinum || inumber >= startinum + INOPB(&sblock)) {
-               iblk = itod(&sblock, inumber);
+               iblk = ino_to_fsba(&sblock, inumber);
                if (pbp != 0)
                        pbp->b_flags &= ~B_INUSE;
                pbp = getdatablk(iblk, sblock.fs_bsize);
                if (pbp != 0)
                        pbp->b_flags &= ~B_INUSE;
                pbp = getdatablk(iblk, sblock.fs_bsize);
@@ -214,7 +214,7 @@ getnextinode(inumber)
                errexit("bad inode number %d to nextinode\n", inumber);
        if (inumber >= lastinum) {
                readcnt++;
                errexit("bad inode number %d to nextinode\n", inumber);
        if (inumber >= lastinum) {
                readcnt++;
-               dblk = fsbtodb(&sblock, itod(&sblock, lastinum));
+               dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
                if (readcnt % readpercg == 0) {
                        size = partialsize;
                        lastinum += partialcnt;
                if (readcnt % readpercg == 0) {
                        size = partialsize;
                        lastinum += partialcnt;
index 4242c7a..2c893b5 100644 (file)
@@ -15,7 +15,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)fsdb.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)fsdb.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -94,7 +94,8 @@ static char sccsid[] = "@(#)fsdb.c    8.1 (Berkeley) %G%";
 /*
  * Messy macros that would otherwise clutter up such glamorous code.
  */
 /*
  * Messy macros that would otherwise clutter up such glamorous code.
  */
-#define itob(i)                ((itod(fs, (i)) << FRGSHIFT) + itoo(fs, (i)) * INODE)
+#define itob(i)                ((ino_to_fsba(fs,                               \
+                           (i)) << FRGSHIFT) + ino_to_fsbo(fs, (i)) * INODE)
 #define min(x, y)      ((x) < (y) ? (x) : (y))
 #define        STRINGSIZE(d)   ((long)d->d_reclen - \
                                ((long)&d->d_name[0] - (long)&d->d_ino))
 #define min(x, y)      ((x) < (y) ? (x) : (y))
 #define        STRINGSIZE(d)   ((long)d->d_reclen - \
                                ((long)&d->d_name[0] - (long)&d->d_ino))
index 01427b4..b759311 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkfs.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)mkfs.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <unistd.h>
 #endif /* not lint */
 
 #include <unistd.h>
@@ -913,7 +913,7 @@ iput(ip, ino)
        daddr_t d;
        int c;
 
        daddr_t d;
        int c;
 
-       c = itog(&sblock, ino);
+       c = ino_to_cg(&sblock, ino);
        rdfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize,
            (char *)&acg);
        if (acg.cg_magic != CG_MAGIC) {
        rdfs(fsbtodb(&sblock, cgtod(&sblock, 0)), sblock.fs_cgsize,
            (char *)&acg);
        if (acg.cg_magic != CG_MAGIC) {
@@ -930,9 +930,9 @@ iput(ip, ino)
                printf("fsinit: inode value out of range (%d).\n", ino);
                exit(32);
        }
                printf("fsinit: inode value out of range (%d).\n", ino);
                exit(32);
        }
-       d = fsbtodb(&sblock, itod(&sblock, ino));
+       d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
        rdfs(d, sblock.fs_bsize, buf);
        rdfs(d, sblock.fs_bsize, buf);
-       buf[itoo(&sblock, ino)] = *ip;
+       buf[ino_to_fsbo(&sblock, ino)] = *ip;
        wtfs(d, sblock.fs_bsize, buf);
 }
 
        wtfs(d, sblock.fs_bsize, buf);
 }
 
index 66e4ba6..dfd7c88 100644 (file)
@@ -15,7 +15,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)quotacheck.c       8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)quotacheck.c       8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -510,7 +510,7 @@ getnextinode(inumber)
                err("bad inode number %d to nextinode", inumber);
        if (inumber >= lastinum) {
                readcnt++;
                err("bad inode number %d to nextinode", inumber);
        if (inumber >= lastinum) {
                readcnt++;
-               dblk = fsbtodb(&sblock, itod(&sblock, lastinum));
+               dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
                if (readcnt % readpercg == 0) {
                        size = partialsize;
                        lastinum += partialcnt;
                if (readcnt % readpercg == 0) {
                        size = partialsize;
                        lastinum += partialcnt;
index 3119488..36bf5e1 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)gcore.c    8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)gcore.c    8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -108,9 +108,9 @@ main(argc, argv)
        if (p->p_stat == SZOMB)
                err(1, "%d: zombie", pid);
 
        if (p->p_stat == SZOMB)
                err(1, "%d: zombie", pid);
 
-       if (p->p_flag & SWEXIT)
+       if (p->p_flag & P_WEXIT)
                err(0, "process exiting");
                err(0, "process exiting");
-       if (p->p_flag & SSYS)           /* Swapper or pagedaemon. */
+       if (p->p_flag & P_SYSTEM)       /* Swapper or pagedaemon. */
                err(1, "%d: system process");
 
        if (corefile == NULL) {
                err(1, "%d: system process");
 
        if (corefile == NULL) {
index 7c33ddf..1bebbd8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pigs.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)pigs.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -165,12 +165,11 @@ fetchpigs()
        }
        if (nproc > lastnproc) {
                free(pt);
        }
        if (nproc > lastnproc) {
                free(pt);
-               if ((pt = (struct p_times *) malloc 
-                   ((nproc + 1) * sizeof(struct p_times))) == NULL) {
-                   error("Out of memory");
-                   die(0);
-           }
-
+               if ((pt =
+                   malloc((nproc + 1) * sizeof(struct p_times))) == NULL) {
+                       error("Out of memory");
+                       die(0);
+               }
        }
        lastnproc = nproc;
        /*
        }
        lastnproc = nproc;
        /*
@@ -180,8 +179,8 @@ fetchpigs()
                pt[i].pt_kp = &kpp[i];
                pp = &kpp[i].kp_proc;
                pctp = &pt[i].pt_pctcpu;
                pt[i].pt_kp = &kpp[i];
                pp = &kpp[i].kp_proc;
                pctp = &pt[i].pt_pctcpu;
-               time = pp->p_time;
-               if (time == 0 || (pp->p_flag & SLOAD) == 0)
+               time = pp->p_swtime;
+               if (time == 0 || (pp->p_flag & P_INMEM) == 0)
                        *pctp = 0;
                else
                        *pctp = ((double) pp->p_pctcpu / 
                        *pctp = 0;
                else
                        *pctp = ((double) pp->p_pctcpu / 
@@ -205,7 +204,8 @@ fetchpigs()
 void
 labelpigs()
 {
 void
 labelpigs()
 {
-       wmove(wnd, 0, 0); wclrtoeol(wnd);
+       wmove(wnd, 0, 0);
+       wclrtoeol(wnd);
        mvwaddstr(wnd, 0, 20,
            "/0   /10  /20  /30  /40  /50  /60  /70  /80  /90  /100");
 }
        mvwaddstr(wnd, 0, 20,
            "/0   /10  /20  /30  /40  /50  /60  /70  /80  /90  /100");
 }
index d20a897..3bd5803 100644 (file)
@@ -6,43 +6,39 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)proc_compare.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)proc_compare.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+
+#include "extern.h"
+
 /*
 /*
- * Returns 1 if p2 is more active than p1
+ * Returns 1 if p2 is "better" than p1
  *
  *
- * The algorithm for picking the "more active" process is thus:
+ * The algorithm for picking the "interesting" process is thus:
  *
  *
- *     1) Runnable processes are favored over anything
- *        else.  The runner with the highest cpu
- *        utilization is picked (p_cpu).  Ties are
+ *     1) Only foreground processes are eligible - implied.
+ *     2) Runnable processes are favored over anything else.  The runner
+ *        with the highest cpu utilization is picked (p_estcpu).  Ties are
  *        broken by picking the highest pid.
  *        broken by picking the highest pid.
- *     2) Next, the sleeper with the shortest sleep
- *        time is favored.  With ties, we pick out
- *        just short-term sleepers (p_pri <= PZERO).
- *        Further ties are broken by picking the highest
- *        pid.
- *
- *     NOTE - if you change this, be sure to consider making
- *        the change in the kernel too (^T in kern/tty.c).
+ *     3) The sleeper with the shortest sleep time is next.  With ties,
+ *        we pick out just "short-term" sleepers (P_SINTR == 0).
+ *     4) Further ties are broken by picking the highest pid.
  *
  *
- *     TODO - consider whether pctcpu should be used
+ * If you change this, be sure to consider making the change in the kernel
+ * too (^T in kern/tty.c).
  *
  *
+ * TODO - consider whether pctcpu should be used.
  */
 
  */
 
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-
-#include "extern.h"
-
-#define isrun(p)       (((p)->p_stat == SRUN) || ((p)->p_stat == SIDL))
-
-#define        TESTAB(a, b)    ((a)<<1 | (b))
-#define        ONLYA   2
-#define        ONLYB   1
-#define        BOTH    3
+#define ISRUN(p)       (((p)->p_stat == SRUN) || ((p)->p_stat == SIDL))
+#define TESTAB(a, b)    ((a)<<1 | (b))
+#define ONLYA   2
+#define ONLYB   1
+#define BOTH    3
 
 int
 proc_compare(p1, p2)
 
 int
 proc_compare(p1, p2)
@@ -54,7 +50,7 @@ proc_compare(p1, p2)
        /*
         * see if at least one of them is runnable
         */
        /*
         * see if at least one of them is runnable
         */
-       switch (TESTAB(isrun(p1), isrun(p2))) {
+       switch (TESTAB(ISRUN(p1), ISRUN(p2))) {
        case ONLYA:
                return (0);
        case ONLYB:
        case ONLYA:
                return (0);
        case ONLYB:
@@ -63,14 +59,14 @@ proc_compare(p1, p2)
                /*
                 * tie - favor one with highest recent cpu utilization
                 */
                /*
                 * tie - favor one with highest recent cpu utilization
                 */
-               if (p2->p_cpu > p1->p_cpu)
+               if (p2->p_estcpu > p1->p_estcpu)
                        return (1);
                        return (1);
-               if (p1->p_cpu > p2->p_cpu)
+               if (p1->p_estcpu > p2->p_estcpu)
                        return (0);
                return (p2->p_pid > p1->p_pid); /* tie - return highest pid */
        }
        /*
                        return (0);
                return (p2->p_pid > p1->p_pid); /* tie - return highest pid */
        }
        /*
-        * weed out zombies
+        * weed out zombies
         */
        switch (TESTAB(p1->p_stat == SZOMB, p2->p_stat == SZOMB)) {
        case ONLYA:
         */
        switch (TESTAB(p1->p_stat == SZOMB, p2->p_stat == SZOMB)) {
        case ONLYA:
@@ -78,9 +74,9 @@ proc_compare(p1, p2)
        case ONLYB:
                return (0);
        case BOTH:
        case ONLYB:
                return (0);
        case BOTH:
-               return (p2->p_pid > p1->p_pid); /* tie - return highest pid */
+               return (p2->p_pid > p1->p_pid); /* tie - return highest pid */
        }
        }
-       /* 
+       /*
         * pick the one with the smallest sleep time
         */
        if (p2->p_slptime > p1->p_slptime)
         * pick the one with the smallest sleep time
         */
        if (p2->p_slptime > p1->p_slptime)
@@ -90,9 +86,9 @@ proc_compare(p1, p2)
        /*
         * favor one sleeping in a non-interruptible sleep
         */
        /*
         * favor one sleeping in a non-interruptible sleep
         */
-        if (p1->p_flag&SSINTR && (p2->p_flag&SSINTR) == 0)
-                return (1);
-        if (p2->p_flag&SSINTR && (p1->p_flag&SSINTR) == 0)
-                return (0);
-       return(p2->p_pid > p1->p_pid);          /* tie - return highest pid */
+       if (p1->p_flag & P_SINTR && (p2->p_flag & P_SINTR) == 0)
+               return (1);
+       if (p2->p_flag & P_SINTR && (p1->p_flag & P_SINTR) == 0)
+               return (0);
+       return (p2->p_pid > p1->p_pid);         /* tie - return highest pid */
 }
 }
index 7ca892d..9dfbbad 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)mkproto.c  8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)mkproto.c  8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -22,8 +22,10 @@ static char sccsid[] = "@(#)mkproto.c        8.1 (Berkeley) %G%";
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/dir.h>
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/dir.h>
+
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>
+
 #include <stdio.h>
 
 union {
 #include <stdio.h>
 
 union {
@@ -125,7 +127,7 @@ descend(par, parinum)
                inum = ialloc(&in);
        } else {
                par = &in;
                inum = ialloc(&in);
        } else {
                par = &in;
-               i = itod(fs, ROOTINO);
+               i = ino_to_fsba(fs, ROOTINO);
                rdfs(fsbtodb(fs, i), fs->fs_bsize, (char *)inos);
                dip = &inos[ROOTINO % INOPB(fs)];
                inum = ROOTINO;
                rdfs(fsbtodb(fs, i), fs->fs_bsize, (char *)inos);
                dip = &inos[ROOTINO % INOPB(fs)];
                inum = ROOTINO;
@@ -362,9 +364,9 @@ iput(ip, aibc, ib, inum)
                printf("bad mode %o\n", ip->di_mode);
                exit(1);
        }
                printf("bad mode %o\n", ip->di_mode);
                exit(1);
        }
-       d = fsbtodb(fs, itod(fs, inum));
+       d = fsbtodb(fs, ino_to_fsba(fs, inum));
        rdfs(d, (int)fs->fs_bsize, (char *)buf);
        rdfs(d, (int)fs->fs_bsize, (char *)buf);
-       buf[itoo(fs, inum)] = *ip;
+       buf[ino_to_fsbo(fs, inum)] = *ip;
        wtfs(d, (int)fs->fs_bsize, (char *)buf);
 }
 
        wtfs(d, (int)fs->fs_bsize, (char *)buf);
 }
 
@@ -429,7 +431,7 @@ ialloc(ip)
        int c;
 
        inum = ++ino;
        int c;
 
        inum = ++ino;
-       c = itog(&sblock, inum);
+       c = ino_to_cg(&sblock, inum);
        rdfs(fsbtodb(&sblock, cgtod(&sblock, c)), (int)sblock.fs_cgsize,
            (char *)&acg);
        if (!cg_chkmagic(&acg)) {
        rdfs(fsbtodb(&sblock, cgtod(&sblock, c)), (int)sblock.fs_cgsize,
            (char *)&acg);
        if (!cg_chkmagic(&acg)) {
index 4b1d78f..c598b6f 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)pstat.c    8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)pstat.c    8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -376,25 +376,25 @@ ufs_print(vp)
 
        KGETRET(VTOI(vp), &inode, sizeof(struct inode), "vnode's inode");
        flag = ip->i_flag;
 
        KGETRET(VTOI(vp), &inode, sizeof(struct inode), "vnode's inode");
        flag = ip->i_flag;
-       if (flag & ILOCKED)
+       if (flag & IN_LOCKED)
                *flags++ = 'L';
                *flags++ = 'L';
-       if (flag & IWANT)
+       if (flag & IN_WANTED)
                *flags++ = 'W';
                *flags++ = 'W';
-       if (flag & IRENAME)
+       if (flag & IN_RENAME)
                *flags++ = 'R';
                *flags++ = 'R';
-       if (flag & IUPD)
+       if (flag & IN_UPDATE)
                *flags++ = 'U';
                *flags++ = 'U';
-       if (flag & IACC)
+       if (flag & IN_ACCESS)
                *flags++ = 'A';
                *flags++ = 'A';
-       if (flag & ICHG)
+       if (flag & IN_CHANGE)
                *flags++ = 'C';
                *flags++ = 'C';
-       if (flag & IMOD)
+       if (flag & IN_MODIFIED)
                *flags++ = 'M';
                *flags++ = 'M';
-       if (flag & ISHLOCK)
+       if (flag & IN_SHLOCK)
                *flags++ = 'S';
                *flags++ = 'S';
-       if (flag & IEXLOCK)
+       if (flag & IN_EXLOCK)
                *flags++ = 'E';
                *flags++ = 'E';
-       if (flag & ILWAIT)
+       if (flag & IN_LWAIT)
                *flags++ = 'Z';
        if (flag == 0)
                *flags++ = '-';
                *flags++ = 'Z';
        if (flag == 0)
                *flags++ = '-';
@@ -680,7 +680,7 @@ kinfo_vnodes(avnodes)
        return ((struct e_vnode *)vbuf);
 }
        
        return ((struct e_vnode *)vbuf);
 }
        
-char hdr[]="  LINE RAW CAN OUT  HWT LWT     ADDR COL STATE  SESS  PGID DISC\n";
+char hdr[]="  LINE RAW CAN OUT  HWT LWT     COL STATE  SESS  PGID DISC\n";
 int ttyspace = 128;
 
 void
 int ttyspace = 128;
 
 void
@@ -796,8 +796,8 @@ ttyprt(tp, line)
        else
                (void)printf("%7s ", name);
        (void)printf("%2d %3d ", tp->t_rawq.c_cc, tp->t_canq.c_cc);
        else
                (void)printf("%7s ", name);
        (void)printf("%2d %3d ", tp->t_rawq.c_cc, tp->t_canq.c_cc);
-       (void)printf("%3d %4d %3d %8x %3d ", tp->t_outq.c_cc, 
-               tp->t_hiwat, tp->t_lowat, tp->t_addr, tp->t_col);
+       (void)printf("%3d %4d %3d %3d ", tp->t_outq.c_cc, 
+               tp->t_hiwat, tp->t_lowat, tp->t_column);
        for (i = j = 0; ttystates[i].flag; i++)
                if (tp->t_state&ttystates[i].flag)
                        state[j++] = ttystates[i].val;
        for (i = j = 0; ttystates[i].flag; i++)
                if (tp->t_state&ttystates[i].flag)
                        state[j++] = ttystates[i].val;
index 0044f06..8ee33ff 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)quot.c     8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)quot.c     8.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -174,7 +174,7 @@ check(file, fsdir)
        }
        nfiles = sblock.fs_ipg * sblock.fs_ncg;
        for (ino = 0; ino < nfiles; ) {
        }
        nfiles = sblock.fs_ipg * sblock.fs_ncg;
        for (ino = 0; ino < nfiles; ) {
-               iblk = fsbtodb(&sblock, itod(&sblock, ino));
+               iblk = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
                bread(fd, (off_t)iblk * dev_bsize, itab, (int)sblock.fs_bsize);
                for (j = 0; j < INOPB(&sblock) && ino < nfiles; j++, ino++) {
                        if (ino < ROOTINO)
                bread(fd, (off_t)iblk * dev_bsize, itab, (int)sblock.fs_bsize);
                for (j = 0; j < INOPB(&sblock) && ino < nfiles; j++, ino++) {
                        if (ino < ROOTINO)