VFS accounting: fix vfs_register()
authorFrancois Tigeot <ftigeot@wolfpond.org>
Sun, 15 Apr 2012 18:41:10 +0000 (20:41 +0200)
committerFran├žois Tigeot <ftigeot@wolfpond.org>
Sun, 15 Apr 2012 18:46:44 +0000 (20:46 +0200)
* Do not register per mount-point initialization and destruction
  functions if VFS accounting is not globally enabled.

sys/kern/vfs_init.c

index c8559e0..99c5226 100644 (file)
@@ -432,10 +432,10 @@ vfs_register(struct vfsconf *vfc)
        }
 
        /* file system uid and gid accounting */
-       if (vfsops->vfs_acinit == NULL) {
+       if (vfs_accounting_enabled && vfsops->vfs_acinit == NULL) {
                vfsops->vfs_acinit = vfs_stdac_init;
        }
-       if (vfsops->vfs_acdone == NULL) {
+       if (vfs_accounting_enabled && vfsops->vfs_acdone == NULL) {
                vfsops->vfs_acdone = vfs_stdac_done;
        }