BSD 4_3_Reno release
[unix-history] / usr / src / sys / nfs / nfs_vnops.c
index 0628ed9..11f2c9a 100644 (file)
@@ -5,15 +5,29 @@
  * 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.48 (Berkeley) %G%
+ *     @(#)nfs_vnops.c 7.46 (Berkeley) 7/26/90
  */
 
 /*
  * vnode op calls for sun nfs version 2
  */
 
  */
 
 /*
  * vnode op calls for sun nfs version 2
  */
 
+#include "machine/pte.h"
 #include "machine/mtpr.h"
 #include "param.h"
 #include "user.h"
 #include "machine/mtpr.h"
 #include "param.h"
 #include "user.h"
 #include "kernel.h"
 #include "mount.h"
 #include "buf.h"
 #include "kernel.h"
 #include "mount.h"
 #include "buf.h"
+#include "vm.h"
 #include "malloc.h"
 #include "mbuf.h"
 #include "errno.h"
 #include "file.h"
 #include "conf.h"
 #include "vnode.h"
 #include "malloc.h"
 #include "mbuf.h"
 #include "errno.h"
 #include "file.h"
 #include "conf.h"
 #include "vnode.h"
+#include "text.h"
 #include "map.h"
 #include "../ufs/quota.h"
 #include "../ufs/inode.h"
 #include "map.h"
 #include "../ufs/quota.h"
 #include "../ufs/inode.h"
@@ -552,7 +568,6 @@ nfsmout:
                ndp->ni_vp = newvp;
                if (lockparent)
                        nfs_lock(vp);
                ndp->ni_vp = newvp;
                if (lockparent)
                        nfs_lock(vp);
-               m_freem(mrep);
                return (0);
        }
 
                return (0);
        }
 
@@ -1634,7 +1649,15 @@ nfs_doio(bp)
                        nfsstats.read_physios++;
                        bp->b_error = error = nfs_readrpc(vp, uiop,
                                bp->b_rcred, bp->b_proc);
                        nfsstats.read_physios++;
                        bp->b_error = error = nfs_readrpc(vp, uiop,
                                bp->b_rcred, bp->b_proc);
-                       (void) vnode_pager_uncache(vp);
+                       /*
+                        * If a text file has been modified since it was exec'd
+                        * blow the process' out of the water. This is the
+                        * closest we can come to "Text File Busy" in good old
+                        * stateless nfs.
+                        */
+                       if ((vp->v_flag & VTEXT) &&
+                           (vp->v_text->x_mtime != np->n_vattr.va_mtime.tv_sec))
+                               xinval(vp);
                } else {
                        uiop->uio_rw = UIO_WRITE;
                        nfsstats.write_physios++;
                } else {
                        uiop->uio_rw = UIO_WRITE;
                        nfsstats.write_physios++;