Print this page
*** NO COMMENTS ***

@@ -122,11 +122,10 @@
  */
 /*ARGSUSED*/
 void
 smbfs_purge_caches(struct vnode *vp)
 {
-#if 0   /* not yet: mmap support */
         /*
          * NFS: Purge the DNLC for this vp,
          * Clear any readdir state bits,
          * the readlink response cache, ...
          */

@@ -134,13 +133,12 @@
 
         /*
          * Flush the page cache.
          */
         if (vn_has_cached_data(vp)) {
-                (void) VOP_PUTPAGE(vp, (u_offset_t)0, 0, B_INVAL, cr, NULL);
+                (void) VOP_PUTPAGE(vp, (u_offset_t) 0, 0, B_INVAL, np->r_cred, NULL);
         }
-#endif  /* not yet */
 }
 
 /*
  * Check the attribute cache to see if the new attributes match
  * those cached.  If they do, the various `data' caches are

@@ -292,17 +290,16 @@
         newsize = fap->fa_size;
         if (vtype == VDIR && newsize < DEV_BSIZE)
                 newsize = DEV_BSIZE;
 
         if (np->r_size != newsize) {
-#if 0   /* not yet: mmap support */
-                if (!vn_has_cached_data(vp) || ...)
-                        /* XXX: See NFS page cache code. */
-#endif  /* not yet */
+                if (!vn_has_cached_data(vp) 
+                    || (!(np->r_flags & RDIRTY)&& np->r_count == 0)) {
                 /* OK to set the size. */
                 np->r_size = newsize;
         }
+        }
 
         /* NFS: np->r_flags &= ~RWRITEATTR; */
         np->n_flag &= ~NATTRCHANGED;
 
         mutex_exit(&np->r_statelock);