Disable VFS accounting by default
authorFrançois Tigeot <ftigeot@wolfpond.org>
Wed, 14 Dec 2011 09:53:46 +0000 (10:53 +0100)
committerFrançois Tigeot <ftigeot@wolfpond.org>
Wed, 14 Dec 2011 12:30:26 +0000 (13:30 +0100)
* Enable it globally with vfs.accounting.enable="1" in loader.conf

sys/kern/vfs_quota.c

index 5273176..4f7b88b 100644 (file)
@@ -109,10 +109,16 @@ gnode_insert(struct mount *mp, gid_t gid)
        return gnp;
 }
 
+static int vfs_accounting_enabled = 0; /* global vfs accounting enable */
+TUNABLE_INT("vfs.accounting.enable", &vfs_accounting_enabled);
+
 /* initializes global accounting data */
 void
 vq_init(struct mount *mp) {
 
+       if (!vfs_accounting_enabled)
+               return;
+
        /* initialize the rb trees */
        RB_INIT(&mp->mnt_acct.ac_uroot);
        RB_INIT(&mp->mnt_acct.ac_groot);