BSD 4_3_Reno release
[unix-history] / usr / src / sys / nfs / nfs_vnops.c
index 60a77e7..11f2c9a 100644 (file)
@@ -5,9 +5,22 @@
  * This code is derived from software contributed to Berkeley by
  * Rick Macklem at The University of Guelph.
  *
  * This code is derived from software contributed to Berkeley by
  * Rick Macklem at The University of Guelph.
  *
- * %sccs.include.redist.c%
+ * Redistribution is only permitted until one year after the first shipment
+ * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
+ * binary forms are permitted provided that: (1) source distributions retain
+ * this entire copyright notice and comment, and (2) distributions including
+ * binaries display the following acknowledgement:  This product includes
+ * software developed by the University of California, Berkeley and its
+ * contributors'' in the documentation or other materials provided with the
+ * distribution and in all advertising materials mentioning features or use
+ * of this software.  Neither the name of the University nor the names of
+ * its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  *
- *     @(#)nfs_vnops.c 7.44 (Berkeley) %G%
+ *     @(#)nfs_vnops.c 7.46 (Berkeley) 7/26/90
  */
 
 /*
  */
 
 /*
@@ -396,7 +409,11 @@ nfs_setattr(vp, vap, cred)
        else
                sp->sa_gid = txdr_unsigned(vap->va_gid);
        sp->sa_size = txdr_unsigned(vap->va_size);
        else
                sp->sa_gid = txdr_unsigned(vap->va_gid);
        sp->sa_size = txdr_unsigned(vap->va_size);
-       if (vap->va_size != VNOVAL) {
+       sp->sa_atime.tv_sec = txdr_unsigned(vap->va_atime.tv_sec);
+       sp->sa_atime.tv_usec = txdr_unsigned(vap->va_flags);
+       txdr_time(&vap->va_mtime, &sp->sa_mtime);
+       if (vap->va_size != VNOVAL || vap->va_mtime.tv_sec != VNOVAL ||
+           vap->va_atime.tv_sec != VNOVAL) {
                np = VTONFS(vp);
                if (np->n_flag & NMODIFIED) {
                        np->n_flag &= ~NMODIFIED;
                np = VTONFS(vp);
                if (np->n_flag & NMODIFIED) {
                        np->n_flag &= ~NMODIFIED;
@@ -404,9 +421,6 @@ nfs_setattr(vp, vap, cred)
                        np->n_attrstamp = 0;
                }
        }
                        np->n_attrstamp = 0;
                }
        }
-       sp->sa_atime.tv_sec = txdr_unsigned(vap->va_atime.tv_sec);
-       sp->sa_atime.tv_usec = txdr_unsigned(vap->va_flags);
-       txdr_time(&vap->va_mtime, &sp->sa_mtime);
        nfsm_request(vp, NFSPROC_SETATTR, u.u_procp, 1);
        nfsm_loadattr(vp, (struct vattr *)0);
        /* should we fill in any vap fields ?? */
        nfsm_request(vp, NFSPROC_SETATTR, u.u_procp, 1);
        nfsm_loadattr(vp, (struct vattr *)0);
        /* should we fill in any vap fields ?? */
@@ -1553,7 +1567,7 @@ nfs_doio(bp)
        int error;
        struct uio uio;
        struct iovec io;
        int error;
        struct uio uio;
        struct iovec io;
-#if !defined(hp300)
+#if !defined(hp300) && !defined(i386)
        register struct pte *pte, *ppte;
        register caddr_t vaddr;
        int npf, npf2;
        register struct pte *pte, *ppte;
        register caddr_t vaddr;
        int npf, npf2;
@@ -1581,7 +1595,7 @@ nfs_doio(bp)
                cr->cr_uid = rp->p_uid;
                cr->cr_gid = 0;         /* Anything ?? */
                cr->cr_ngroups = 1;
                cr->cr_uid = rp->p_uid;
                cr->cr_gid = 0;         /* Anything ?? */
                cr->cr_ngroups = 1;
-#if defined(hp300)
+#if defined(hp300) || defined(i386)
                /* mapping was already done by vmapbuf */
                io.iov_base = bp->b_un.b_addr;
 #else
                /* mapping was already done by vmapbuf */
                io.iov_base = bp->b_un.b_addr;
 #else
@@ -1655,7 +1669,7 @@ nfs_doio(bp)
                 * Finally, release pte's used by physical i/o
                 */
                crfree(cr);
                 * Finally, release pte's used by physical i/o
                 */
                crfree(cr);
-#if !defined(hp300)
+#if !defined(hp300) && !defined(i386)
                rmfree(nfsmap, (long)npf2, (long)++reg);
                if (nfsmap_want) {
                        nfsmap_want = 0;
                rmfree(nfsmap, (long)npf2, (long)++reg);
                if (nfsmap_want) {
                        nfsmap_want = 0;