update for new VM
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 6 Dec 1990 09:38:37 +0000 (01:38 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Thu, 6 Dec 1990 09:38:37 +0000 (01:38 -0800)
SCCS-vsn: sys/miscfs/specfs/spec_vnops.c 7.29
SCCS-vsn: sys/kern/subr_log.c 7.10
SCCS-vsn: sys/kern/subr_prf.c 7.19
SCCS-vsn: sys/kern/subr_rmap.c 7.5
SCCS-vsn: sys/kern/sys_process.c 7.14
SCCS-vsn: sys/kern/uipc_mbuf.c 7.18
SCCS-vsn: sys/kern/sysv_shm.c 7.10
SCCS-vsn: sys/kern/vfs_syscalls.c 7.60
SCCS-vsn: sys/kern/kern_exit.c 7.29
SCCS-vsn: sys/kern/kern_proc.c 7.13
SCCS-vsn: sys/kern/kern_sig.c 7.25
SCCS-vsn: sys/kern/kern_synch.c 7.13
SCCS-vsn: sys/kern/tty.c 7.37
SCCS-vsn: sys/kern/vfs_vnops.c 7.25

14 files changed:
usr/src/sys/kern/kern_exit.c
usr/src/sys/kern/kern_proc.c
usr/src/sys/kern/kern_sig.c
usr/src/sys/kern/kern_synch.c
usr/src/sys/kern/subr_log.c
usr/src/sys/kern/subr_prf.c
usr/src/sys/kern/subr_rmap.c
usr/src/sys/kern/sys_process.c
usr/src/sys/kern/sysv_shm.c
usr/src/sys/kern/tty.c
usr/src/sys/kern/uipc_mbuf.c
usr/src/sys/kern/vfs_syscalls.c
usr/src/sys/kern/vfs_vnops.c
usr/src/sys/miscfs/specfs/spec_vnops.c

index 351e3e0..073a833 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_exit.c 7.28 (Berkeley) %G%
+ *     @(#)kern_exit.c 7.29 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -17,7 +17,6 @@
 #include "proc.h"
 #include "buf.h"
 #include "wait.h"
 #include "proc.h"
 #include "buf.h"
 #include "wait.h"
-#include "vm.h"
 #include "file.h"
 #include "vnode.h"
 #include "syslog.h"
 #include "file.h"
 #include "vnode.h"
 #include "syslog.h"
 #include "machine/psl.h"
 #endif
 
 #include "machine/psl.h"
 #endif
 
+#include "../vm/vm_param.h"
+#include "../vm/vm_map.h"
+#include "../vm/vm_kern.h"
+
 /*
  * Exit system call: pass back caller's arg
  */
 /*
  * Exit system call: pass back caller's arg
  */
@@ -73,18 +76,16 @@ exit(p, rv)
        for (i = 0; i < NSIG; i++)
                u.u_signal[i] = SIG_IGN;
        untimeout(realitexpire, (caddr_t)p);
        for (i = 0; i < NSIG; i++)
                u.u_signal[i] = SIG_IGN;
        untimeout(realitexpire, (caddr_t)p);
+#ifdef SYSVSHM
+       if (p->p_shm)
+               shmexit(p);
+#endif
+       vm_map_deallocate(p->p_map);
+       p->p_map = VM_MAP_NULL;
        /*
        /*
-        * Release virtual memory.  If we resulted from
-        * a vfork(), instead give the resources back to
-        * the parent.
+        * XXX preserve synchronization semantics of vfork
         */
         */
-       if ((p->p_flag & SVFORK) == 0) {
-#ifdef MAPMEM
-               if (u.u_mmap)
-                       (void) mmexit(p);
-#endif
-               vrelvm();
-       } else {
+       if (p->p_flag & SVFORK) {
                p->p_flag &= ~SVFORK;
                wakeup((caddr_t)p);
                while ((p->p_flag & SVFDONE) == 0)
                p->p_flag &= ~SVFORK;
                wakeup((caddr_t)p);
                while ((p->p_flag & SVFDONE) == 0)
@@ -139,21 +140,16 @@ exit(p, rv)
        if (p->p_tracep)
                vrele(p->p_tracep);
 #endif
        if (p->p_tracep)
                vrele(p->p_tracep);
 #endif
-       /*
-        * Freeing the user structure and kernel stack
-        * for the current process: have to run a bit longer
-        * using the pages which are about to be freed...
-        * vrelu will block memory allocation by raising ipl.
-        */
-       vrelu(p, 0);
-       vrelpt(p);
+       splimp();
+       /* I don't think this will cause a sleep/realloc anywhere... */
+       kmem_free(kernel_map, (vm_offset_t)p->p_addr,
+                 round_page(ctob(UPAGES)));
        if (*p->p_prev = p->p_nxt)              /* off allproc queue */
                p->p_nxt->p_prev = p->p_prev;
        if (p->p_nxt = zombproc)                /* onto zombproc */
                p->p_nxt->p_prev = &p->p_nxt;
        p->p_prev = &zombproc;
        zombproc = p;
        if (*p->p_prev = p->p_nxt)              /* off allproc queue */
                p->p_nxt->p_prev = p->p_prev;
        if (p->p_nxt = zombproc)                /* onto zombproc */
                p->p_nxt->p_prev = &p->p_nxt;
        p->p_prev = &zombproc;
        zombproc = p;
-       multprog--;
        p->p_stat = SZOMB;
        noproc = 1;
        for (pp = &pidhash[PIDHASH(p->p_pid)]; *pp; pp = &(*pp)->p_hash)
        p->p_stat = SZOMB;
        noproc = 1;
        for (pp = &pidhash[PIDHASH(p->p_pid)]; *pp; pp = &(*pp)->p_hash)
@@ -163,14 +159,8 @@ exit(p, rv)
                }
        panic("exit");
 done:
                }
        panic("exit");
 done:
-       if (p->p_pid == 1) {
-               if (p->p_dsize == 0) {
-                       printf("Can't exec init (errno %d)\n", WEXITSTATUS(rv));
-                       for (;;)
-                               ;
-               } else
-                       panic("init died");
-       }
+       if (p->p_pid == 1)
+               panic("init died");
        p->p_xstat = rv;
        *p->p_ru = u.u_ru;
        i = splclock();
        p->p_xstat = rv;
        *p->p_ru = u.u_ru;
        i = splclock();
index db1412f..7b05c9a 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_proc.c 7.12 (Berkeley) %G%
+ *     @(#)kern_proc.c 7.13 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -17,8 +17,6 @@
 #include "seg.h"
 #include "acct.h"
 #include "wait.h"
 #include "seg.h"
 #include "acct.h"
 #include "wait.h"
-#include "vm.h"
-#include "text.h"
 #include "file.h"
 #include "../ufs/quota.h"
 #include "uio.h"
 #include "file.h"
 #include "../ufs/quota.h"
 #include "uio.h"
@@ -28,7 +26,6 @@
 #include "tty.h"
 
 #include "machine/reg.h"
 #include "tty.h"
 
 #include "machine/reg.h"
-#include "machine/pte.h"
 #include "machine/psl.h"
 
 /*
 #include "machine/psl.h"
 
 /*
index 21d605b..8e517e9 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_sig.c  7.24 (Berkeley) %G%
+ *     @(#)kern_sig.c  7.25 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -15,9 +15,7 @@
 #include "timeb.h"
 #include "times.h"
 #include "buf.h"
 #include "timeb.h"
 #include "times.h"
 #include "buf.h"
-#include "text.h"
 #include "seg.h"
 #include "seg.h"
-#include "vm.h"
 #include "acct.h"
 #include "uio.h"
 #include "file.h"
 #include "acct.h"
 #include "uio.h"
 #include "file.h"
@@ -26,9 +24,9 @@
 #include "ktrace.h"
 
 #include "machine/reg.h"
 #include "ktrace.h"
 
 #include "machine/reg.h"
-#include "machine/pte.h"
 #include "machine/psl.h"
 #include "machine/mtpr.h"
 #include "machine/psl.h"
 #include "machine/mtpr.h"
+#include "../vm/vm_param.h"
 
 #define        ttystopsigmask  (sigmask(SIGTSTP)|sigmask(SIGTTIN)|sigmask(SIGTTOU))
 #define        stopsigmask     (sigmask(SIGSTOP)|ttystopsigmask)
 
 #define        ttystopsigmask  (sigmask(SIGTSTP)|sigmask(SIGTTIN)|sigmask(SIGTTOU))
 #define        stopsigmask     (sigmask(SIGSTOP)|ttystopsigmask)
@@ -589,7 +587,7 @@ psignal(p, sig)
                 * and don't clear any pending SIGCONT.
                 */
                if (p->p_pgrp->pg_jobc == 0 && action == SIG_DFL)
                 * and don't clear any pending SIGCONT.
                 */
                if (p->p_pgrp->pg_jobc == 0 && action == SIG_DFL)
-                       return;
+                       return;
                /* FALLTHROUGH */
 
        case SIGSTOP:
                /* FALLTHROUGH */
 
        case SIGSTOP:
@@ -972,13 +970,6 @@ core()
        if (ctob(UPAGES + u.u_dsize + u.u_ssize) >=
            u.u_rlimit[RLIMIT_CORE].rlim_cur)
                return (EFAULT);
        if (ctob(UPAGES + u.u_dsize + u.u_ssize) >=
            u.u_rlimit[RLIMIT_CORE].rlim_cur)
                return (EFAULT);
-       if (p->p_textp) {
-               VOP_LOCK(p->p_textp->x_vptr);
-               error = VOP_ACCESS(p->p_textp->x_vptr, VREAD, u.u_cred);
-               VOP_UNLOCK(p->p_textp->x_vptr);
-               if (error)
-                       return (EFAULT);
-       }
        ndp->ni_segflg = UIO_SYSSPACE;
        ndp->ni_dirp = "core";
        if (error = vn_open(ndp, FCREAT|FWRITE, 0644))
        ndp->ni_segflg = UIO_SYSSPACE;
        ndp->ni_dirp = "core";
        if (error = vn_open(ndp, FCREAT|FWRITE, 0644))
@@ -991,12 +982,6 @@ core()
                vput(vp);
                return (EFAULT);
        }
                vput(vp);
                return (EFAULT);
        }
-#ifdef MAPMEM
-       if (error = mmcore(p)) {
-               vput(vp);
-               return (error);
-       }
-#endif
        VATTR_NULL(&vattr);
        vattr.va_size = 0;
        VOP_SETATTR(vp, &vattr, u.u_cred);
        VATTR_NULL(&vattr);
        vattr.va_size = 0;
        VOP_SETATTR(vp, &vattr, u.u_cred);
@@ -1014,14 +999,13 @@ core()
        error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&u, ctob(UPAGES), (off_t)0,
            UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, ndp->ni_cred, (int *)0);
        if (error == 0)
        error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&u, ctob(UPAGES), (off_t)0,
            UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, ndp->ni_cred, (int *)0);
        if (error == 0)
-               error = vn_rdwr(UIO_WRITE, vp,
-                   (caddr_t)ctob(dptov(p, 0)),
+               error = vn_rdwr(UIO_WRITE, vp, u.u_daddr,
                    (int)ctob(u.u_dsize), (off_t)ctob(UPAGES), UIO_USERSPACE,
                    IO_NODELOCKED|IO_UNIT, ndp->ni_cred, (int *)0);
        if (error == 0)
                error = vn_rdwr(UIO_WRITE, vp,
                    (int)ctob(u.u_dsize), (off_t)ctob(UPAGES), UIO_USERSPACE,
                    IO_NODELOCKED|IO_UNIT, ndp->ni_cred, (int *)0);
        if (error == 0)
                error = vn_rdwr(UIO_WRITE, vp,
-                   (caddr_t)ctob(sptov(p, u.u_ssize - 1)),
-                   (int)ctob(u.u_ssize),
+                   trunc_page(USRSTACK - ctob(u.u_ssize)),
+                   round_page(ctob(u.u_ssize)),
                    (off_t)ctob(UPAGES) + ctob(u.u_dsize), UIO_USERSPACE,
                    IO_NODELOCKED|IO_UNIT, ndp->ni_cred, (int *)0);
        vput(vp);
                    (off_t)ctob(UPAGES) + ctob(u.u_dsize), UIO_USERSPACE,
                    IO_NODELOCKED|IO_UNIT, ndp->ni_cred, (int *)0);
        vput(vp);
index 659b766..f7abfbc 100644 (file)
@@ -3,21 +3,19 @@
  * 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.
  *
- *     @(#)kern_synch.c        7.12 (Berkeley) %G%
+ *     @(#)kern_synch.c        7.13 (Berkeley) %G%
  */
 
  */
 
-#include "machine/pte.h"
-#include "machine/psl.h"
-#include "machine/mtpr.h"
-
 #include "param.h"
 #include "systm.h"
 #include "user.h"
 #include "proc.h"
 #include "param.h"
 #include "systm.h"
 #include "user.h"
 #include "proc.h"
-#include "vm.h"
 #include "kernel.h"
 #include "buf.h"
 
 #include "kernel.h"
 #include "buf.h"
 
+#include "machine/psl.h"
+#include "machine/mtpr.h"
+
 /*
  * Force switch among equal priority processes every 100ms.
  */
 /*
  * Force switch among equal priority processes every 100ms.
  */
@@ -540,8 +538,6 @@ setpri(pp)
 
        p = (pp->p_cpu & 0377)/4;
        p += PUSER + 2 * pp->p_nice;
 
        p = (pp->p_cpu & 0377)/4;
        p += PUSER + 2 * pp->p_nice;
-       if (pp->p_rssize > pp->p_maxrss && freemem < desfree)
-               p += 2*4;       /* effectively, nice(4) */
        if (p > 127)
                p = 127;
        if (p < curpri) {
        if (p > 127)
                p = 127;
        if (p < curpri) {
index 4932438..8f7bda5 100644 (file)
@@ -1,9 +1,10 @@
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
  *
  *
- *     @(#)subr_log.c  7.9 (Berkeley) %G%
+ * %sccs.include.redist.c%
+ *
+ *     @(#)subr_log.c  7.10 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -36,6 +37,7 @@ int   log_open;                       /* also used in log() */
 logopen(dev)
        dev_t dev;
 {
 logopen(dev)
        dev_t dev;
 {
+       register struct msgbuf *mbp = msgbufp;
 
        if (log_open)
                return (EBUSY);
 
        if (log_open)
                return (EBUSY);
@@ -46,13 +48,13 @@ logopen(dev)
         * called by autoconf, msg_magic should be initialized by the time
         * we get here.
         */
         * called by autoconf, msg_magic should be initialized by the time
         * we get here.
         */
-       if (msgbuf.msg_magic != MSG_MAGIC) {
+       if (mbp->msg_magic != MSG_MAGIC) {
                register int i;
 
                register int i;
 
-               msgbuf.msg_magic = MSG_MAGIC;
-               msgbuf.msg_bufx = msgbuf.msg_bufr = 0;
+               mbp->msg_magic = MSG_MAGIC;
+               mbp->msg_bufx = mbp->msg_bufr = 0;
                for (i=0; i < MSG_BSIZE; i++)
                for (i=0; i < MSG_BSIZE; i++)
-                       msgbuf.msg_bufc[i] = 0;
+                       mbp->msg_bufc[i] = 0;
        }
        return (0);
 }
        }
        return (0);
 }
@@ -72,18 +74,19 @@ logread(dev, uio, flag)
        struct uio *uio;
        int flag;
 {
        struct uio *uio;
        int flag;
 {
+       register struct msgbuf *mbp = msgbufp;
        register long l;
        register int s;
        int error = 0;
 
        s = splhigh();
        register long l;
        register int s;
        int error = 0;
 
        s = splhigh();
-       while (msgbuf.msg_bufr == msgbuf.msg_bufx) {
+       while (mbp->msg_bufr == mbp->msg_bufx) {
                if (flag & IO_NDELAY) {
                        splx(s);
                        return (EWOULDBLOCK);
                }
                logsoftc.sc_state |= LOG_RDWAIT;
                if (flag & IO_NDELAY) {
                        splx(s);
                        return (EWOULDBLOCK);
                }
                logsoftc.sc_state |= LOG_RDWAIT;
-               if (error = tsleep((caddr_t)&msgbuf, LOG_RDPRI | PCATCH,
+               if (error = tsleep((caddr_t)mbp, LOG_RDPRI | PCATCH,
                    "klog", 0)) {
                        splx(s);
                        return (error);
                    "klog", 0)) {
                        splx(s);
                        return (error);
@@ -93,19 +96,19 @@ logread(dev, uio, flag)
        logsoftc.sc_state &= ~LOG_RDWAIT;
 
        while (uio->uio_resid > 0) {
        logsoftc.sc_state &= ~LOG_RDWAIT;
 
        while (uio->uio_resid > 0) {
-               l = msgbuf.msg_bufx - msgbuf.msg_bufr;
+               l = mbp->msg_bufx - mbp->msg_bufr;
                if (l < 0)
                if (l < 0)
-                       l = MSG_BSIZE - msgbuf.msg_bufr;
+                       l = MSG_BSIZE - mbp->msg_bufr;
                l = MIN(l, uio->uio_resid);
                if (l == 0)
                        break;
                l = MIN(l, uio->uio_resid);
                if (l == 0)
                        break;
-               error = uiomove((caddr_t)&msgbuf.msg_bufc[msgbuf.msg_bufr],
+               error = uiomove((caddr_t)&mbp->msg_bufc[mbp->msg_bufr],
                        (int)l, uio);
                if (error)
                        break;
                        (int)l, uio);
                if (error)
                        break;
-               msgbuf.msg_bufr += l;
-               if (msgbuf.msg_bufr < 0 || msgbuf.msg_bufr >= MSG_BSIZE)
-                       msgbuf.msg_bufr = 0;
+               mbp->msg_bufr += l;
+               if (mbp->msg_bufr < 0 || mbp->msg_bufr >= MSG_BSIZE)
+                       mbp->msg_bufr = 0;
        }
        return (error);
 }
        }
        return (error);
 }
@@ -120,7 +123,7 @@ logselect(dev, rw)
        switch (rw) {
 
        case FREAD:
        switch (rw) {
 
        case FREAD:
-               if (msgbuf.msg_bufr != msgbuf.msg_bufx) {
+               if (msgbufp->msg_bufr != msgbufp->msg_bufx) {
                        splx(s);
                        return (1);
                }
                        splx(s);
                        return (1);
                }
@@ -148,7 +151,7 @@ logwakeup()
                        psignal(p, SIGIO);
        }
        if (logsoftc.sc_state & LOG_RDWAIT) {
                        psignal(p, SIGIO);
        }
        if (logsoftc.sc_state & LOG_RDWAIT) {
-               wakeup((caddr_t)&msgbuf);
+               wakeup((caddr_t)msgbufp);
                logsoftc.sc_state &= ~LOG_RDWAIT;
        }
 }
                logsoftc.sc_state &= ~LOG_RDWAIT;
        }
 }
@@ -165,7 +168,7 @@ logioctl(dev, com, data, flag)
        /* return number of characters immediately available */
        case FIONREAD:
                s = splhigh();
        /* return number of characters immediately available */
        case FIONREAD:
                s = splhigh();
-               l = msgbuf.msg_bufx - msgbuf.msg_bufr;
+               l = msgbufp->msg_bufx - msgbufp->msg_bufr;
                splx(s);
                if (l < 0)
                        l += MSG_BSIZE;
                splx(s);
                if (l < 0)
                        l += MSG_BSIZE;
index cfbc955..21016b2 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.
  *
- *     @(#)subr_prf.c  7.18 (Berkeley) %G%
+ *     @(#)subr_prf.c  7.19 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -12,7 +12,6 @@
 #include "buf.h"
 #include "conf.h"
 #include "reboot.h"
 #include "buf.h"
 #include "conf.h"
 #include "reboot.h"
-#include "vm.h"
 #include "msgbuf.h"
 #include "user.h"
 #include "proc.h"
 #include "msgbuf.h"
 #include "user.h"
 #include "proc.h"
@@ -371,6 +370,7 @@ putchar(c, flags, ttyp)
        register int c;
        struct tty *ttyp;
 {
        register int c;
        struct tty *ttyp;
 {
+       register struct msgbuf *mbp = msgbufp;
        extern int msgbufmapped;
 
        if (panicstr)
        extern int msgbufmapped;
 
        if (panicstr)
@@ -388,17 +388,17 @@ putchar(c, flags, ttyp)
                constty = 0;
        if ((flags & TOLOG) && c != '\0' && c != '\r' && c != 0177 &&
            msgbufmapped) {
                constty = 0;
        if ((flags & TOLOG) && c != '\0' && c != '\r' && c != 0177 &&
            msgbufmapped) {
-               if (msgbuf.msg_magic != MSG_MAGIC) {
+               if (mbp->msg_magic != MSG_MAGIC) {
                        register int i;
 
                        register int i;
 
-                       msgbuf.msg_magic = MSG_MAGIC;
-                       msgbuf.msg_bufx = msgbuf.msg_bufr = 0;
+                       mbp->msg_magic = MSG_MAGIC;
+                       mbp->msg_bufx = mbp->msg_bufr = 0;
                        for (i=0; i < MSG_BSIZE; i++)
                        for (i=0; i < MSG_BSIZE; i++)
-                               msgbuf.msg_bufc[i] = 0;
+                               mbp->msg_bufc[i] = 0;
                }
                }
-               msgbuf.msg_bufc[msgbuf.msg_bufx++] = c;
-               if (msgbuf.msg_bufx < 0 || msgbuf.msg_bufx >= MSG_BSIZE)
-                       msgbuf.msg_bufx = 0;
+               mbp->msg_bufc[mbp->msg_bufx++] = c;
+               if (mbp->msg_bufx < 0 || mbp->msg_bufx >= MSG_BSIZE)
+                       mbp->msg_bufx = 0;
        }
                (*v_console)(c);
 }
        }
                (*v_console)(c);
 }
index 02fe2ec..eb0cef7 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.
  *
- *     @(#)subr_rmap.c 7.4 (Berkeley) %G%
+ *     @(#)subr_rmap.c 7.5 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -11,7 +11,6 @@
 #include "map.h"
 #include "user.h"
 #include "proc.h"
 #include "map.h"
 #include "user.h"
 #include "proc.h"
-#include "text.h"
 #include "kernel.h"
 
 /*
 #include "kernel.h"
 
 /*
index f4c4f5a..3aa6303 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.
  *
- *     @(#)sys_process.c       7.13 (Berkeley) %G%
+ *     @(#)sys_process.c       7.14 (Berkeley) %G%
  */
 
 #define IPCREG
  */
 
 #define IPCREG
 #include "user.h"
 #include "proc.h"
 #include "vnode.h"
 #include "user.h"
 #include "proc.h"
 #include "vnode.h"
-#include "text.h"
 #include "seg.h"
 #include "buf.h"
 #include "ptrace.h"
 
 #include "machine/reg.h"
 #include "machine/psl.h"
 #include "seg.h"
 #include "buf.h"
 #include "ptrace.h"
 
 #include "machine/reg.h"
 #include "machine/psl.h"
-#include "machine/pte.h"
+#include "../vm/vm_page.h"
+#include "../vm/vm_prot.h"
 
 /*
  * Priority for tracing
 
 /*
  * Priority for tracing
@@ -95,8 +95,6 @@ procxmt(p)
        register struct proc *p;
 {
        register int i, *poff;
        register struct proc *p;
 {
        register int i, *poff;
-       register struct text *xp;
-       struct vattr vattr;
 
        if (ipc.ip_lock != p->p_pid)
                return (0);
 
        if (ipc.ip_lock != p->p_pid)
                return (0);
@@ -130,37 +128,22 @@ procxmt(p)
                break;
 
        case PT_WRITE_I:                /* write the child's text space */
                break;
 
        case PT_WRITE_I:                /* write the child's text space */
-               /*
-                * If text, must assure exclusive use
-                */
-               if (xp = p->p_textp) {
-                       if (xp->x_count != 1 ||
-                           VOP_GETATTR(xp->x_vptr, &vattr, u.u_cred) ||
-                           (vattr.va_mode & VSVTX))
-                               goto error;
-                       xp->x_flag |= XTRC;
-               }
-               i = -1;
                if ((i = suiword((caddr_t)ipc.ip_addr, ipc.ip_data)) < 0) {
                if ((i = suiword((caddr_t)ipc.ip_addr, ipc.ip_data)) < 0) {
-                       if (!chgprot((caddr_t)ipc.ip_addr, RW) &&
-                           !chgprot((caddr_t)ipc.ip_addr+(sizeof(int)-1), RW))
+                       vm_offset_t sa, ea;
+                       int rv;
+
+                       sa = trunc_page((vm_offset_t)ipc.ip_addr);
+                       ea = round_page((vm_offset_t)ipc.ip_addr+sizeof(int)-1);
+                       rv = vm_map_protect(p->p_map, sa, ea,
+                                       VM_PROT_DEFAULT, FALSE);
+                       if (rv == KERN_SUCCESS) {
                                i = suiword((caddr_t)ipc.ip_addr, ipc.ip_data);
                                i = suiword((caddr_t)ipc.ip_addr, ipc.ip_data);
-                       (void) chgprot((caddr_t)ipc.ip_addr, RO);
-                       (void) chgprot((caddr_t)ipc.ip_addr+(sizeof(int)-1), RO);
+                               (void) vm_map_protect(p->p_map, sa, ea,
+                                       VM_PROT_READ|VM_PROT_EXECUTE, FALSE);
+                       }
                }
                if (i < 0)
                        goto error;
                }
                if (i < 0)
                        goto error;
-#if defined(tahoe)
-               /* make sure the old value is not in cache */
-               ckeyrelease(p->p_ckey);
-               p->p_ckey = getcodekey();
-#endif
-               if (xp) {
-                       xp->x_flag |= XWRIT;
-#if defined(tahoe)
-                       xp->x_ckey = p->p_ckey;
-#endif
-               }
                break;
 
        case PT_WRITE_D:                /* write the child's data space */
                break;
 
        case PT_WRITE_D:                /* write the child's data space */
index 7bedea8..698f59a 100644 (file)
@@ -11,7 +11,7 @@
  *
  * from: Utah $Hdr: uipc_shm.c 1.9 89/08/14$
  *
  *
  * from: Utah $Hdr: uipc_shm.c 1.9 89/08/14$
  *
- *     @(#)sysv_shm.c  7.9 (Berkeley) %G%
+ *     @(#)sysv_shm.c  7.10 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 
 #ifdef SYSVSHM
 
 
 #ifdef SYSVSHM
 
-#include "machine/pte.h"
-
 #include "param.h"
 #include "systm.h"
 #include "user.h"
 #include "kernel.h"
 #include "proc.h"
 #include "param.h"
 #include "systm.h"
 #include "user.h"
 #include "kernel.h"
 #include "proc.h"
-#include "vm.h"
 #include "shm.h"
 #include "shm.h"
-#include "mapmem.h"
 #include "malloc.h"
 #include "malloc.h"
+#include "mman.h"
+#include "../vm/vm_param.h"
+#include "../vm/vm_map.h"
+#include "../vm/vm_kern.h"
+#include "../vm/vm_inherit.h"
+#include "../vm/vm_pager.h"
 
 #ifdef HPUXCOMPAT
 #include "../hpux/hpux.h"
 
 #ifdef HPUXCOMPAT
 #include "../hpux/hpux.h"
@@ -42,13 +44,32 @@ int shmat(), shmctl(), shmdt(), shmget();
 int    (*shmcalls[])() = { shmat, shmctl, shmdt, shmget };
 int    shmtot = 0;
 
 int    (*shmcalls[])() = { shmat, shmctl, shmdt, shmget };
 int    shmtot = 0;
 
-int    shmfork(), shmexit();
-struct mapmemops shmops = { shmfork, (int (*)())0, shmexit, shmexit };
+/*
+ * Per process internal structure for managing segments.
+ * Each process using shm will have an array of ``shmseg'' of these.
+ */
+struct shmdesc {
+       vm_offset_t     shmd_uva;
+       int             shmd_id;
+};
+
+/*
+ * Per segment internal structure (shm_handle).
+ */
+struct shmhandle {
+       vm_offset_t     shmh_kva;
+       caddr_t         shmh_id;
+};
+
+vm_map_t shm_map;      /* address space for shared memory segments */
 
 shminit()
 {
        register int i;
 
 shminit()
 {
        register int i;
+       vm_offset_t whocares1, whocares2;
 
 
+       shm_map = kmem_suballoc(kernel_map, &whocares1, &whocares2,
+                               shminfo.shmall * NBPG, FALSE);
        if (shminfo.shmmni > SHMMMNI)
                shminfo.shmmni = SHMMMNI;
        for (i = 0; i < shminfo.shmmni; i++) {
        if (shminfo.shmmni > SHMMMNI)
                shminfo.shmmni = SHMMMNI;
        for (i = 0; i < shminfo.shmmni; i++) {
@@ -89,7 +110,7 @@ shmget(p, uap, retval)
        register struct ucred *cred = u.u_cred;
        register int i;
        int error, size, rval = 0;
        register struct ucred *cred = u.u_cred;
        register int i;
        int error, size, rval = 0;
-       caddr_t kva;
+       register struct shmhandle *shmh;
 
        /* look up the specified shm_id */
        if (uap->key != IPC_PRIVATE) {
 
        /* look up the specified shm_id */
        if (uap->key != IPC_PRIVATE) {
@@ -129,19 +150,22 @@ shmget(p, uap, retval)
                 */
                shp->shm_perm.mode = SHM_ALLOC | SHM_DEST;
                shp->shm_perm.key = uap->key;
                 */
                shp->shm_perm.mode = SHM_ALLOC | SHM_DEST;
                shp->shm_perm.key = uap->key;
-               kva = (caddr_t) malloc((u_long)ctob(size), M_SHM, M_WAITOK);
-               if (kva == NULL) {
+               shmh = (struct shmhandle *)
+                       malloc(sizeof(struct shmhandle), M_SHM, M_WAITOK);
+               shmh->shmh_kva = 0;
+               shmh->shmh_id = (caddr_t)(0xc0000000|rval);     /* XXX */
+               error = vm_mmap(shm_map, &shmh->shmh_kva, ctob(size),
+                               VM_PROT_ALL, MAP_ANON, shmh->shmh_id, 0);
+               if (error) {
+                       free((caddr_t)shmh, M_SHM);
                        shp->shm_perm.mode = 0;
                        shp->shm_perm.mode = 0;
-                       return (ENOMEM);
+                       return(ENOMEM);
                }
                }
-               if (!claligned(kva))
-                       panic("shmget: non-aligned memory");
-               bzero(kva, (u_int)ctob(size));
+               shp->shm_handle = (void *) shmh;
                shmtot += size;
                shp->shm_perm.cuid = shp->shm_perm.uid = cred->cr_uid;
                shp->shm_perm.cgid = shp->shm_perm.gid = cred->cr_gid;
                shp->shm_perm.mode = SHM_ALLOC | (uap->shmflg&0777);
                shmtot += size;
                shp->shm_perm.cuid = shp->shm_perm.uid = cred->cr_uid;
                shp->shm_perm.cgid = shp->shm_perm.gid = cred->cr_gid;
                shp->shm_perm.mode = SHM_ALLOC | (uap->shmflg&0777);
-               shp->shm_handle = (void *) kvtopte(kva);
                shp->shm_segsz = uap->size;
                shp->shm_cpid = p->p_pid;
                shp->shm_lpid = shp->shm_nattch = 0;
                shp->shm_segsz = uap->size;
                shp->shm_cpid = p->p_pid;
                shp->shm_lpid = shp->shm_nattch = 0;
@@ -246,10 +270,23 @@ shmat(p, uap, retval)
 {
        register struct shmid_ds *shp;
        register int size;
 {
        register struct shmid_ds *shp;
        register int size;
-       struct mapmem *mp;
        caddr_t uva;
        caddr_t uva;
-       int error, prot, shmmapin();
+       int error;
+       int flags;
+       vm_prot_t prot;
+       struct shmdesc *shmd;
 
 
+       /*
+        * Allocate descriptors now (before validity check)
+        * in case malloc() blocks.
+        */
+       shmd = (struct shmdesc *)p->p_shm;
+       size = shminfo.shmseg * sizeof(struct shmdesc);
+       if (shmd == NULL) {
+               shmd = (struct shmdesc *)malloc(size, M_SHM, M_WAITOK);
+               bzero((caddr_t)shmd, size);
+               p->p_shm = (caddr_t)shmd;
+       }
        if (error = shmvalid(uap->shmid))
                return (error);
        shp = &shmsegs[uap->shmid % SHMMMNI];
        if (error = shmvalid(uap->shmid))
                return (error);
        shp = &shmsegs[uap->shmid % SHMMMNI];
@@ -268,28 +305,28 @@ shmat(p, uap, retval)
        /*
         * Make sure user doesn't use more than their fair share
         */
        /*
         * Make sure user doesn't use more than their fair share
         */
-       size = 0;
-       for (mp = u.u_mmap; mp; mp = mp->mm_next)
-               if (mp->mm_ops == &shmops)
-                       size++;
+       for (size = 0; size < shminfo.shmseg; size++) {
+               if (shmd->shmd_uva == 0)
+                       break;
+               shmd++;
+       }
        if (size >= shminfo.shmseg)
                return (EMFILE);
        if (size >= shminfo.shmseg)
                return (EMFILE);
-       /*
-        * Allocate a mapped memory region descriptor and
-        * attempt to expand the user page table to allow for region
-        */
-       prot = (uap->shmflg & SHM_RDONLY) ? MM_RO : MM_RW;
-#if defined(hp300)
-       prot |= MM_CI;
-#endif
        size = ctob(clrnd(btoc(shp->shm_segsz)));
        size = ctob(clrnd(btoc(shp->shm_segsz)));
-       error = mmalloc(p, uap->shmid, &uva, (segsz_t)size, prot, &shmops, &mp);
+       prot = VM_PROT_READ;
+       if ((uap->shmflg & SHM_RDONLY) == 0)
+               prot |= VM_PROT_WRITE;
+       flags = MAP_ANON|MAP_SHARED;
+       if (uva)
+               flags |= MAP_FIXED;
+       else
+               uva = (caddr_t)0x1000000;       /* XXX */
+       error = vm_mmap(p->p_map, &uva, (vm_size_t)size, prot, flags,
+                       ((struct shmhandle *)shp->shm_handle)->shmh_id, 0);
        if (error)
        if (error)
-               return (error);
-       if (error = mmmapin(p, mp, shmmapin)) {
-               (void) mmfree(p, mp);
-               return (error);
-       }
+               return(error);
+       shmd->shmd_uva = (vm_offset_t)uva;
+       shmd->shmd_id = uap->shmid;
        /*
         * Fill in the remaining fields
         */
        /*
         * Fill in the remaining fields
         */
@@ -311,48 +348,54 @@ shmdt(p, uap, retval)
        } *uap;
        int *retval;
 {
        } *uap;
        int *retval;
 {
-       register struct mapmem *mp;
+       register struct shmdesc *shmd;
+       register int i;
 
 
-       for (mp = u.u_mmap; mp; mp = mp->mm_next)
-               if (mp->mm_ops == &shmops && mp->mm_uva == uap->shmaddr)
+       shmd = (struct shmdesc *)p->p_shm;
+       for (i = 0; i < shminfo.shmseg; i++, shmd++)
+               if (shmd->shmd_uva &&
+                   shmd->shmd_uva == (vm_offset_t)uap->shmaddr)
                        break;
                        break;
-       if (mp == MMNIL)
-               return (EINVAL);
-       shmsegs[mp->mm_id % SHMMMNI].shm_lpid = p->p_pid;
-       return (shmufree(p, mp));
+       if (i == shminfo.shmseg)
+               return(EINVAL);
+       shmufree(p, shmd);
+       shmsegs[shmd->shmd_id % SHMMMNI].shm_lpid = p->p_pid;
 }
 
 }
 
-shmmapin(mp, off)
-       struct mapmem *mp;
+shmfork(rip, rpp, isvfork)
+       struct proc *rip, *rpp;
+       int isvfork;
 {
 {
-       register struct shmid_ds *shp;
-
-       shp = &shmsegs[mp->mm_id % SHMMMNI];
-       if (off >= ctob(clrnd(btoc(shp->shm_segsz))))
-               return(-1);
-       return(((struct pte *)shp->shm_handle)[btop(off)].pg_pfnum);
-}
+       register struct shmdesc *shmd;
+       register int size;
 
 
-/*
- * Increment attach count on fork
- */
-/* ARGSUSED */
-shmfork(mp, ischild)
-       register struct mapmem *mp;
-{
-       if (!ischild)
-               shmsegs[mp->mm_id % SHMMMNI].shm_nattch++;
+       /*
+        * Copy parents descriptive information
+        */
+       size = shminfo.shmseg * sizeof(struct shmdesc);
+       shmd = (struct shmdesc *)malloc(size, M_SHM, M_WAITOK);
+       bcopy((caddr_t)rip->p_shm, (caddr_t)shmd, size);
+       rpp->p_shm = (caddr_t)shmd;
+       /*
+        * Increment reference counts
+        */
+       for (size = 0; size < shminfo.shmseg; size++, shmd++)
+               if (shmd->shmd_uva)
+                       shmsegs[shmd->shmd_id % SHMMMNI].shm_nattch++;
 }
 
 }
 
-/*
- * Detach from shared memory segment on exit (or exec)
- */
-shmexit(mp)
-       struct mapmem *mp;
+shmexit(p)
+       struct proc *p;
 {
 {
-       struct proc *p = u.u_procp;             /* XXX */
+       register struct shmdesc *shmd;
+       register int i;
 
 
-       return (shmufree(p, mp));
+       shmd = (struct shmdesc *)p->p_shm;
+       for (i = 0; i < shminfo.shmseg; i++, shmd++)
+               if (shmd->shmd_uva)
+                       shmufree(p, shmd);
+       free((caddr_t)p->p_shm, M_SHM);
+       p->p_shm = NULL;
 }
 
 shmvalid(id)
 }
 
 shmvalid(id)
@@ -372,20 +415,20 @@ shmvalid(id)
 /*
  * Free user resources associated with a shared memory segment
  */
 /*
  * Free user resources associated with a shared memory segment
  */
-shmufree(p, mp)
+shmufree(p, shmd)
        struct proc *p;
        struct proc *p;
-       struct mapmem *mp;
+       struct shmdesc *shmd;
 {
        register struct shmid_ds *shp;
 {
        register struct shmid_ds *shp;
-       int error;
 
 
-       shp = &shmsegs[mp->mm_id % SHMMMNI];
-       mmmapout(p, mp);
-       error = mmfree(p, mp);
+       shp = &shmsegs[shmd->shmd_id % SHMMMNI];
+       (void) vm_deallocate(p->p_map, shmd->shmd_uva,
+                            ctob(clrnd(btoc(shp->shm_segsz))));
+       shmd->shmd_id = 0;
+       shmd->shmd_uva = 0;
        shp->shm_dtime = time.tv_sec;
        if (--shp->shm_nattch <= 0 && (shp->shm_perm.mode & SHM_DEST))
                shmfree(shp);
        shp->shm_dtime = time.tv_sec;
        if (--shp->shm_nattch <= 0 && (shp->shm_perm.mode & SHM_DEST))
                shmfree(shp);
-       return (error);
 }
 
 /*
 }
 
 /*
@@ -398,8 +441,14 @@ shmfree(shp)
 
        if (shp->shm_handle == NULL)
                panic("shmfree");
 
        if (shp->shm_handle == NULL)
                panic("shmfree");
-       kva = (caddr_t) ptetokv(shp->shm_handle);
-       free(kva, M_SHM);
+       /*
+        * Lose our lingering object reference by deallocating space
+        * in kernel.  Pager will also be deallocated as a side-effect.
+        */
+       vm_deallocate(shm_map,
+                     ((struct shmhandle *)shp->shm_handle)->shmh_kva,
+                     clrnd(btoc(shp->shm_segsz)));
+       free((caddr_t)shp->shm_handle, M_SHM);
        shp->shm_handle = NULL;
        shmtot -= clrnd(btoc(shp->shm_segsz));
        shp->shm_perm.mode = 0;
        shp->shm_handle = NULL;
        shmtot -= clrnd(btoc(shp->shm_segsz));
        shp->shm_perm.mode = 0;
@@ -444,5 +493,4 @@ ipcaccess(ipc, mode, cred)
                return (0);
        return (EACCES);
 }
                return (0);
        return (EACCES);
 }
-
 #endif /* SYSVSHM */
 #endif /* SYSVSHM */
index bbfc207..140d7fe 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.
  *
- *     @(#)tty.c       7.36 (Berkeley) %G%
+ *     @(#)tty.c       7.37 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1729,7 +1729,7 @@ ttyinfo(tp)
                tputchar('.', tp);
                ttyoutint(x%100, 10, 2, tp);
 #endif
                tputchar('.', tp);
                ttyoutint(x%100, 10, 2, tp);
 #endif
-               ttyprintf(tp, "%% %dk\n", pgtok(pick->p_ssize + pick->p_dsize));
+               ttyprintf(tp, "%% %dk\n", pgtok(pick->p_rssize));
        }
        tp->t_rocount = 0;      /* so pending input will be retyped if BS */
 }
        }
        tp->t_rocount = 0;      /* so pending input will be retyped if BS */
 }
index cfae569..0bc437f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)uipc_mbuf.c 7.17 (Berkeley) %G%
+ *     @(#)uipc_mbuf.c 7.18 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
 #include "map.h"
 #define MBTYPES
 #include "mbuf.h"
 #include "map.h"
 #define MBTYPES
 #include "mbuf.h"
-#include "vm.h"
 #include "kernel.h"
 #include "syslog.h"
 #include "domain.h"
 #include "protosw.h"
 #include "kernel.h"
 #include "syslog.h"
 #include "domain.h"
 #include "protosw.h"
-#include "machine/pte.h"
+#include "../vm/vm_param.h"
+#include "../vm/vm_map.h"
+
+extern vm_map_t mb_map;
+struct mbuf *mbutl;
+char *mclrefcnt;
 
 mbinit()
 {
        int s;
 
 
 mbinit()
 {
        int s;
 
-#if MCLBYTES < 4096
+#if CLBYTES < 4096
 #define NCL_INIT       (4096/CLBYTES)
 #else
 #define NCL_INIT       1
 #define NCL_INIT       (4096/CLBYTES)
 #else
 #define NCL_INIT       1
@@ -54,20 +58,14 @@ m_clalloc(ncl, canwait)
        static int logged;
 
        npg = ncl * CLSIZE;
        static int logged;
 
        npg = ncl * CLSIZE;
-       mbx = rmalloc(mbmap, (long)npg);
-       if (mbx == 0) {
+       p = (caddr_t)kmem_malloc(mb_map, ctob(npg), canwait);
+       if (p == NULL) {
                if (logged == 0) {
                        logged++;
                if (logged == 0) {
                        logged++;
-                       log(LOG_ERR, "mbuf map full\n");
+                       log(LOG_ERR, "mb_map full\n");
                }
                return (0);
        }
                }
                return (0);
        }
-       p = cltom(mbx * NBPG / MCLBYTES);
-       if (memall(&Mbmap[mbx], npg, proc, CSYS) == 0) {
-               rmfree(mbmap, (long)npg, (long)mbx);
-               return (0);
-       }
-       vmaccess(&Mbmap[mbx], p, npg);
        ncl = ncl * CLBYTES / MCLBYTES;
        for (i = 0; i < ncl; i++) {
                ((union mcluster *)p)->mcl_next = mclfree;
        ncl = ncl * CLBYTES / MCLBYTES;
        for (i = 0; i < ncl; i++) {
                ((union mcluster *)p)->mcl_next = mclfree;
index c943eb3..943f60f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)vfs_syscalls.c      7.59 (Berkeley) %G%
+ *     @(#)vfs_syscalls.c      7.60 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -231,7 +231,7 @@ dounmount(mp, flags)
        if (error = vfs_lock(mp))
                return (error);
 
        if (error = vfs_lock(mp))
                return (error);
 
-       xumount(mp);            /* remove unused sticky files from text table */
+       vnode_pager_umount(mp); /* release cached vnodes */
        cache_purgevfs(mp);     /* remove cache entries for this file sys */
        if ((error = VFS_SYNC(mp, MNT_WAIT)) == 0 || (flags & MNT_FORCE))
                error = VFS_UNMOUNT(mp, flags);
        cache_purgevfs(mp);     /* remove cache entries for this file sys */
        if ((error = VFS_SYNC(mp, MNT_WAIT)) == 0 || (flags & MNT_FORCE))
                error = VFS_UNMOUNT(mp, flags);
@@ -829,8 +829,7 @@ unlink(p, uap, retval)
                error = EBUSY;
                goto out;
        }
                error = EBUSY;
                goto out;
        }
-       if (vp->v_flag & VTEXT)
-               xrele(vp);      /* try once to free text */
+       (void) vnode_pager_uncache(vp);
 out:
        if (!error) {
                error = VOP_REMOVE(ndp);
 out:
        if (!error) {
                error = VOP_REMOVE(ndp);
index ec79f91..7716713 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)vfs_vnops.c 7.24 (Berkeley) %G%
+ *     @(#)vfs_vnops.c 7.25 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -134,9 +134,7 @@ vn_writechk(vp)
         * the vnode, try to free it up once.  If
         * we fail, we can't allow writing.
         */
         * the vnode, try to free it up once.  If
         * we fail, we can't allow writing.
         */
-       if (vp->v_flag & VTEXT)
-               xrele(vp);
-       if (vp->v_flag & VTEXT)
+       if ((vp->v_flag & VTEXT) && !vnode_pager_uncache(vp))
                return (ETXTBSY);
        return (0);
 }
                return (ETXTBSY);
        return (0);
 }
index 18b40d7..dcb1260 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)spec_vnops.c        7.28 (Berkeley) %G%
+ *     @(#)spec_vnops.c        7.29 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -221,8 +221,8 @@ spec_write(vp, uio, ioflag, cred)
        daddr_t bn;
        int bsize, blkmask;
        struct partinfo dpart;
        daddr_t bn;
        int bsize, blkmask;
        struct partinfo dpart;
-       register int n, on, i;
-       int count, error = 0;
+       register int n, on;
+       int error = 0;
        extern int mem_no;
 
        if (uio->uio_rw != UIO_WRITE)
        extern int mem_no;
 
        if (uio->uio_rw != UIO_WRITE)
@@ -260,9 +260,6 @@ spec_write(vp, uio, ioflag, cred)
                        bn = (uio->uio_offset / DEV_BSIZE) &~ blkmask;
                        on = uio->uio_offset % bsize;
                        n = MIN((unsigned)(bsize - on), uio->uio_resid);
                        bn = (uio->uio_offset / DEV_BSIZE) &~ blkmask;
                        on = uio->uio_offset % bsize;
                        n = MIN((unsigned)(bsize - on), uio->uio_resid);
-                       count = howmany(bsize, CLBYTES);
-                       for (i = 0; i < count; i++)
-                               munhash(vp, bn + i * (CLBYTES / DEV_BSIZE));
                        if (n == bsize)
                                bp = getblk(vp, bn, bsize);
                        else
                        if (n == bsize)
                                bp = getblk(vp, bn, bsize);
                        else