VFS accounting: do not set vp->v_pfsmp for non-nullfs mounts
authorFrancois Tigeot <ftigeot@wolfpond.org>
Sun, 25 Mar 2012 08:27:07 +0000 (10:27 +0200)
committerFran├žois Tigeot <ftigeot@wolfpond.org>
Sun, 25 Mar 2012 09:08:02 +0000 (11:08 +0200)
* the test in _cache_setvp() was wrong and was initializing a pfs-specific
  accounting variable in vnodes for all filesystem types, possibly causing
  unnecessary work for each filesystem write operation.

sys/kern/vfs_cache.c

index 62b8469..19031fc 100644 (file)
@@ -904,7 +904,8 @@ _cache_setvp(struct mount *mp, struct namecache *ncp, struct vnode *vp)
                /* XXX: this is a hack to work-around the lack of a real pfs vfs
                 * implementation*/
                if (mp != NULL)
-                       vp->v_pfsmp = mp;
+                       if (strncmp(mp->mnt_stat.f_fstypename, "null", 5) == 0)
+                               vp->v_pfsmp = mp;
        } else {
                /*
                 * When creating a negative cache hit we set the