From 59a9a88c5cca8d1be8bbe8c39d2a0018e5521d7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Tigeot?= Date: Tue, 17 Apr 2012 22:27:36 +0200 Subject: [PATCH] Rename vfs_accounting_enabled to vfs_quota_enabled --- sys/kern/vfs_init.c | 6 +++--- sys/kern/vfs_mount.c | 2 +- sys/kern/vfs_quota.c | 14 +++++++------- sys/kern/vfs_syscalls.c | 4 ++-- sys/kern/vfs_vopops.c | 2 +- sys/sys/mount.h | 6 +++--- sys/sys/vfs_quota.h | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 99c52261e1..2301d99811 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -431,11 +431,11 @@ vfs_register(struct vfsconf *vfc) vfsops->vfs_ncpgen_test = vfs_stdncpgen_test; } - /* file system uid and gid accounting */ - if (vfs_accounting_enabled && vfsops->vfs_acinit == NULL) { + /* VFS quota uid and gid accounting */ + if (vfs_quota_enabled && vfsops->vfs_acinit == NULL) { vfsops->vfs_acinit = vfs_stdac_init; } - if (vfs_accounting_enabled && vfsops->vfs_acdone == NULL) { + if (vfs_quota_enabled && vfsops->vfs_acdone == NULL) { vfsops->vfs_acdone = vfs_stdac_done; } diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 6810003dfe..43e66a3c6a 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -850,7 +850,7 @@ mountlist_remove(struct mount *mp) * mountlist_exists (MP SAFE) * * Checks if a node exists in the mountlist. - * This function is mainly used by VFS accounting code to check if a + * This function is mainly used by VFS quota code to check if a * cached nullfs struct mount pointer is still valid at use time * * FIXME: there is no warranty the mp passed to that function diff --git a/sys/kern/vfs_quota.c b/sys/kern/vfs_quota.c index 20eaa0522c..4d9b5ba75a 100644 --- a/sys/kern/vfs_quota.c +++ b/sys/kern/vfs_quota.c @@ -109,17 +109,17 @@ gnode_insert(struct mount *mp, gid_t gid) return gnp; } -int vfs_accounting_enabled = 0; /* global vfs accounting enable */ -TUNABLE_INT("vfs.accounting_enabled", &vfs_accounting_enabled); -SYSCTL_INT(_vfs, OID_AUTO, accounting_enabled, CTLFLAG_RD, - &vfs_accounting_enabled, 0, "Enable VFS accounting"); +int vfs_quota_enabled = 0; +TUNABLE_INT("vfs.quota_enabled", &vfs_quota_enabled); +SYSCTL_INT(_vfs, OID_AUTO, quota_enabled, CTLFLAG_RD, + &vfs_quota_enabled, 0, "Enable VFS quota"); -/* initializes global accounting data */ +/* initializes per mount-point data structures */ void vq_init(struct mount *mp) { - if (!vfs_accounting_enabled) + if (!vfs_quota_enabled) return; /* initialize the rb trees */ @@ -341,7 +341,7 @@ sys_vquotactl(struct vquotactl_args *vqa) struct mount *mp; int error; - if (!vfs_accounting_enabled) + if (!vfs_quota_enabled) return EOPNOTSUPP; path = vqa->path; error = copyin(vqa->pref, &pref, sizeof(pref)); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 32358bd8d6..11c66a80c7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3425,7 +3425,7 @@ kern_truncate(struct nlookupdata *nd, off_t length) error = EISDIR; goto done; } - if (vfs_accounting_enabled) { + if (vfs_quota_enabled) { error = VOP_GETATTR(vp, &vattr); KASSERT(error == 0, ("kern_truncate(): VOP_GETATTR didn't return 0")); uid = vattr.va_uid; @@ -3500,7 +3500,7 @@ kern_ftruncate(int fd, off_t length) goto done; } - if (vfs_accounting_enabled) { + if (vfs_quota_enabled) { error = VOP_GETATTR(vp, &vattr); KASSERT(error == 0, ("kern_ftruncate(): VOP_GETATTR didn't return 0")); uid = vattr.va_uid; diff --git a/sys/kern/vfs_vopops.c b/sys/kern/vfs_vopops.c index c503d35c7c..5e441866e7 100644 --- a/sys/kern/vfs_vopops.c +++ b/sys/kern/vfs_vopops.c @@ -430,7 +430,7 @@ vop_write(struct vop_ops *ops, struct vnode *vp, struct uio *uio, int ioflag, /* is this a regular vnode ? */ VFS_MPLOCK_FLAG(vp->v_mount, MNTK_WR_MPSAFE); - if (vfs_accounting_enabled && (vp->v_type == VREG)) { + if (vfs_quota_enabled && (vp->v_type == VREG)) { if ((error = VOP_GETATTR(vp, &va)) != 0) goto done; size_before = va.va_size; diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 55ceb3bd02..096e050491 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -146,7 +146,7 @@ struct bio_ops { #endif /* - * storage accounting + * vfs quota accounting * * uids and gids often come in contiguous blocks; use a small linear * array as the basic in-memory accounting allocation unit @@ -631,10 +631,10 @@ struct vfsops { if ((MP->mnt_op->vfs_account != NULL) && (D != 0)) \ MP->mnt_op->vfs_account(MP, U, G, D); #define VFS_ACINIT(MP, ERROR) \ - if (vfs_accounting_enabled && MP->mnt_op->vfs_acinit != NULL) \ + if (vfs_quota_enabled && MP->mnt_op->vfs_acinit != NULL) \ ERROR = MP->mnt_op->vfs_acinit(MP); #define VFS_ACDONE(MP) \ - if (vfs_accounting_enabled && MP->mnt_op->vfs_acdone != NULL) \ + if (vfs_quota_enabled && MP->mnt_op->vfs_acdone != NULL) \ MP->mnt_op->vfs_acdone(MP); #define VFS_NCPGEN_SET(MP, NCP) \ MP->mnt_op->vfs_ncpgen_set(MP, NCP) diff --git a/sys/sys/vfs_quota.h b/sys/sys/vfs_quota.h index 8748aba138..0a4197fc1d 100644 --- a/sys/sys/vfs_quota.h +++ b/sys/sys/vfs_quota.h @@ -42,7 +42,7 @@ extern void vq_done(struct mount*); int vquotactl(const char *path, struct plistref *pref); -extern int vfs_accounting_enabled; +extern int vfs_quota_enabled; #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) struct mount* vq_vptomp(struct vnode *vp); -- 2.41.0