@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_50.c,v 1.12 2012/01/29 06:29:04 dholland Exp $ */
+/* $NetBSD: vfs_syscalls_50.c,v 1.13 2012/01/29 07:16:00 dholland Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.12 2012/01/29 06:29:04 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.13 2012/01/29 07:16:00 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -338,6 +338,7 @@
struct dqblk dqblk;
struct quotaval qv[QUOTA_NLIMITS];
uint64_t *values[QUOTA_NLIMITS];
+ int idtype;
values[QUOTA_LIMIT_BLOCK] = &qv[QUOTA_LIMIT_BLOCK].qv_hardlimit;
values[QUOTA_LIMIT_FILE] = &qv[QUOTA_LIMIT_FILE].qv_hardlimit;
@@ -376,16 +377,18 @@
error = ENOMEM;
if (!prop_array_add_and_rel(datas, data))
goto out_datas;
+ idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
if (!quota_prop_add_command(cmds, "quotaon",
- ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
+ ufs_quota_class_names[idtype],
datas))
goto out_cmds;
goto do_quotaonoff;
case Q_QUOTAOFF:
error = ENOMEM;
+ idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
if (!quota_prop_add_command(cmds, "quotaoff",
- ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
+ ufs_quota_class_names[idtype],
datas))
goto out_cmds;
do_quotaonoff:
@@ -417,8 +420,9 @@
goto out_data;
if (!prop_array_add_and_rel(datas, data))
goto out_datas;
+ idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
if (!quota_prop_add_command(cmds, "get",
- ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
+ ufs_quota_class_names[idtype],
datas))
goto out_cmds;
if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
@@ -473,8 +477,9 @@
goto out_data;
if (!prop_array_add_and_rel(datas, data))
goto out_datas;
+ idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
if (!quota_prop_add_command(cmds, "set",
- ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
+ ufs_quota_class_names[idtype],
datas))
goto out_cmds;
if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
@@ -502,8 +507,9 @@
* emulate with a "get version"
*/
error = ENOMEM;
+ idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
if (!quota_prop_add_command(cmds, "get version",
- ufs_quota_class_names[qtype2ufsclass(q1cmd & SUBCMDMASK)],
+ ufs_quota_class_names[idtype],
datas))
goto out_cmds;
if (!prop_dictionary_set_and_rel(dict, "commands", cmds))
@@ -1,4 +1,4 @@
-/* $NetBSD: quota.h,v 1.28 2011/03/25 10:25:17 bouyer Exp $ */
+/* $NetBSD: quota.h,v 1.29 2012/01/29 07:16:00 dholland Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -55,14 +55,14 @@
#if !defined(HAVE_NBTOOL_CONFIG_H)
-#include <quota/quotaprop.h>
+#include <sys/quota.h>
__inline static int __unused
-ufsclass2qtype(int class)
+quota_idtype_to_ufs(int idtype)
{
- switch(class) {
- case QUOTA_CLASS_USER:
+ switch (idtype) {
+ case QUOTA_IDTYPE_USER:
return USRQUOTA;
- case QUOTA_CLASS_GROUP:
+ case QUOTA_IDTYPE_GROUP:
return GRPQUOTA;
default:
return -1;
@@ -70,13 +70,13 @@
}
static __inline int __unused
-qtype2ufsclass(int type)
+quota_idtype_from_ufs(int ufstype)
{
- switch(type) {
+ switch (ufstype) {
case USRQUOTA:
- return QUOTA_CLASS_USER;
+ return QUOTA_IDTYPE_USER;
case GRPQUOTA:
- return QUOTA_CLASS_GROUP;
+ return QUOTA_IDTYPE_GROUP;
default:
return -1;
}
@@ -1,4 +1,4 @@
-/* $NetBSD: edquota.c,v 1.42 2012/01/29 06:23:20 dholland Exp $ */
+/* $NetBSD: edquota.c,v 1.43 2012/01/29 07:16:00 dholland Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "from: @(#)edquota.c 8.3 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: edquota.c,v 1.42 2012/01/29 06:23:20 dholland Exp $");
+__RCSID("$NetBSD: edquota.c,v 1.43 2012/01/29 07:16:00 dholland Exp $");
#endif
#endif /* not lint */
@@ -288,7 +288,7 @@
return NULL;
if (!hasquota(qfpathname, sizeof(qfpathname), fs,
- ufsclass2qtype(idtype)))
+ quota_idtype_to_ufs(idtype)))
return NULL;
qup = quotause_create();