Print this page
*** NO COMMENTS ***

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_client.c
          +++ new/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_client.c
↓ open down ↓ 116 lines elided ↑ open up ↑
 117  117          return (smbfsgetattr(vp, &va, cr));
 118  118  }
 119  119  
 120  120  /*
 121  121   * Purge all of the various data caches.
 122  122   */
 123  123  /*ARGSUSED*/
 124  124  void
 125  125  smbfs_purge_caches(struct vnode *vp)
 126  126  {
 127      -#if 0   /* not yet: mmap support */
 128  127          /*
 129  128           * NFS: Purge the DNLC for this vp,
 130  129           * Clear any readdir state bits,
 131  130           * the readlink response cache, ...
 132  131           */
 133  132          smbnode_t *np = VTOSMB(vp);
 134  133  
 135  134          /*
 136  135           * Flush the page cache.
 137  136           */
 138  137          if (vn_has_cached_data(vp)) {
 139      -                (void) VOP_PUTPAGE(vp, (u_offset_t)0, 0, B_INVAL, cr, NULL);
      138 +                (void) VOP_PUTPAGE(vp, (u_offset_t) 0, 0, B_INVAL, np->r_cred, NULL);
 140  139          }
 141      -#endif  /* not yet */
 142  140  }
 143  141  
 144  142  /*
 145  143   * Check the attribute cache to see if the new attributes match
 146  144   * those cached.  If they do, the various `data' caches are
 147  145   * considered to be good.  Otherwise, purge the cached data.
 148  146   */
 149  147  void
 150  148  smbfs_cache_check(
 151  149          struct vnode *vp,
↓ open down ↓ 135 lines elided ↑ open up ↑
 287  285           * Also deal with the fact that SMB presents
 288  286           * directories as having size=0.  Doing that
 289  287           * here and leaving fa_size as returned OtW
 290  288           * avoids fixing the size lots of places.
 291  289           */
 292  290          newsize = fap->fa_size;
 293  291          if (vtype == VDIR && newsize < DEV_BSIZE)
 294  292                  newsize = DEV_BSIZE;
 295  293  
 296  294          if (np->r_size != newsize) {
 297      -#if 0   /* not yet: mmap support */
 298      -                if (!vn_has_cached_data(vp) || ...)
 299      -                        /* XXX: See NFS page cache code. */
 300      -#endif  /* not yet */
 301      -                /* OK to set the size. */
 302      -                np->r_size = newsize;
      295 +                if (!vn_has_cached_data(vp) 
      296 +                    || (!(np->r_flags & RDIRTY)&& np->r_count == 0)) {
      297 +                        /* OK to set the size. */
      298 +                        np->r_size = newsize;
      299 +                }
 303  300          }
 304  301  
 305  302          /* NFS: np->r_flags &= ~RWRITEATTR; */
 306  303          np->n_flag &= ~NATTRCHANGED;
 307  304  
 308  305          mutex_exit(&np->r_statelock);
 309  306  
 310  307          if (oldvt != vtype) {
 311  308                  SMBVDEBUG("vtype change %d to %d\n", oldvt, vtype);
 312  309          }
↓ open down ↓ 391 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX