BSD 4_3_Reno release
[unix-history] / usr / src / sys / nfs / nfs_vnops.c
index 0702915..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.45 (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 ?? */