Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Rename struct ufs_quota_entry -> struct quotaval.
details: https://anonhg.NetBSD.org/src/rev/301a2dc2fb7d
branches: trunk
changeset: 771586:301a2dc2fb7d
user: dholland <dholland%NetBSD.org@localhost>
date: Fri Nov 25 16:55:05 2011 +0000
description:
Rename struct ufs_quota_entry -> struct quotaval.
diffstat:
common/include/quota/quota.h | 10 +-
lib/libquota/getfsquota.c | 6 +-
lib/libquota/getnfsquota.c | 27 +++---
lib/libquota/getufsquota.c | 10 +-
libexec/rpc.rquotad/rquotad.c | 24 +++---
sys/compat/common/vfs_syscalls_50.c | 14 +-
sys/sys/quota.h | 18 ++--
sys/ufs/ufs/quota1.h | 7 +-
sys/ufs/ufs/quota1_subr.c | 44 ++++++-----
sys/ufs/ufs/ufs_quota1.c | 28 +++---
usr.bin/quota/getvfsquota.c | 10 +-
usr.bin/quota/getvfsquota.h | 4 +-
usr.bin/quota/quota.c | 60 ++++++++--------
usr.sbin/edquota/edquota.c | 132 ++++++++++++++++++------------------
usr.sbin/repquota/repquota.c | 78 ++++++++++----------
15 files changed, 240 insertions(+), 232 deletions(-)
diffs (truncated from 1149 to 300 lines):
diff -r 26dca961760b -r 301a2dc2fb7d common/include/quota/quota.h
--- a/common/include/quota/quota.h Fri Nov 25 16:52:47 2011 +0000
+++ b/common/include/quota/quota.h Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quota.h,v 1.3 2011/11/20 21:43:34 dholland Exp $ */
+/* $NetBSD: quota.h,v 1.4 2011/11/25 16:55:05 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@@ -50,15 +50,15 @@
/*
* retrieve quotas with ufs semantics from vfs, for the given id and class.
- * second argument points to a struct ufs_quota_entry array of QUOTA_NLIMITS
+ * second argument points to a struct quotaval array of QUOTA_NLIMITS
* elements.
*/
-int getufsquota(const char *, struct ufs_quota_entry *, uid_t, const char *);
+int getufsquota(const char *, struct quotaval *, uid_t, const char *);
/* same as above, but for NFS */
-int getnfsquota(const char *, struct ufs_quota_entry *, uid_t, const char *);
+int getnfsquota(const char *, struct quotaval *, uid_t, const char *);
/* call one of the above, if appropriate, after a statvfs(2) */
-int getfsquota(const char *, struct ufs_quota_entry *, uid_t, const char *);
+int getfsquota(const char *, struct quotaval *, uid_t, const char *);
#endif /* _QUOTA_QUOTA_H_ */
diff -r 26dca961760b -r 301a2dc2fb7d lib/libquota/getfsquota.c
--- a/lib/libquota/getfsquota.c Fri Nov 25 16:52:47 2011 +0000
+++ b/lib/libquota/getfsquota.c Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getfsquota.c,v 1.2 2011/06/07 14:56:12 bouyer Exp $ */
+/* $NetBSD: getfsquota.c,v 1.3 2011/11/25 16:55:05 dholland Exp $ */
/*-
* Copyright (c) 2011 Manuel Bouyer
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: getfsquota.c,v 1.2 2011/06/07 14:56:12 bouyer Exp $");
+__RCSID("$NetBSD: getfsquota.c,v 1.3 2011/11/25 16:55:05 dholland Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -43,7 +43,7 @@
/* retrieve quotas with ufs semantics from vfs, for the given user id */
int
-getfsquota(const char *path, struct ufs_quota_entry *qv, uid_t id,
+getfsquota(const char *path, struct quotaval *qv, uid_t id,
const char *class)
{
struct statvfs v;
diff -r 26dca961760b -r 301a2dc2fb7d lib/libquota/getnfsquota.c
--- a/lib/libquota/getnfsquota.c Fri Nov 25 16:52:47 2011 +0000
+++ b/lib/libquota/getnfsquota.c Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getnfsquota.c,v 1.3 2011/11/20 21:43:35 dholland Exp $ */
+/* $NetBSD: getnfsquota.c,v 1.4 2011/11/25 16:55:05 dholland Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)quota.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: getnfsquota.c,v 1.3 2011/11/20 21:43:35 dholland Exp $");
+__RCSID("$NetBSD: getnfsquota.c,v 1.4 2011/11/25 16:55:05 dholland Exp $");
#endif
#endif /* not lint */
@@ -114,7 +114,7 @@
}
int
-getnfsquota(const char *mp, struct ufs_quota_entry *qv,
+getnfsquota(const char *mp, struct quotaval *qv,
uint32_t id, const char *class)
{
struct getquota_args gq_args;
@@ -178,29 +178,30 @@
gettimeofday(&tv, NULL);
/* blocks*/
- qv[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit = rqlim2qlim(
+ qv[QUOTA_LIMIT_BLOCK].qv_hardlimit = rqlim2qlim(
gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit *
(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE));
- qv[QUOTA_LIMIT_BLOCK].ufsqe_softlimit = rqlim2qlim(
+ qv[QUOTA_LIMIT_BLOCK].qv_softlimit = rqlim2qlim(
gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit *
(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE));
- qv[QUOTA_LIMIT_BLOCK].ufsqe_cur =
+ qv[QUOTA_LIMIT_BLOCK].qv_usage =
gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
- qv[QUOTA_LIMIT_BLOCK].ufsqe_time = (tv.tv_sec +
+ qv[QUOTA_LIMIT_BLOCK].qv_expiretime = (tv.tv_sec +
gq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft);
/* inodes */
- qv[QUOTA_LIMIT_FILE].ufsqe_hardlimit = rqlim2qlim(
+ qv[QUOTA_LIMIT_FILE].qv_hardlimit = rqlim2qlim(
gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit);
- qv[QUOTA_LIMIT_FILE].ufsqe_softlimit = rqlim2qlim(
+ qv[QUOTA_LIMIT_FILE].qv_softlimit = rqlim2qlim(
gq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit);
- qv[QUOTA_LIMIT_FILE].ufsqe_cur =
+ qv[QUOTA_LIMIT_FILE].qv_usage =
gq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles;
- qv[QUOTA_LIMIT_FILE].ufsqe_time = (int)(tv.tv_sec +
+ qv[QUOTA_LIMIT_FILE].qv_expiretime = (int)(tv.tv_sec +
gq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft);
- qv[QUOTA_LIMIT_BLOCK].ufsqe_grace =
- qv[QUOTA_LIMIT_FILE].ufsqe_grace = 0;
+
+ qv[QUOTA_LIMIT_BLOCK].qv_grace =
+ qv[QUOTA_LIMIT_FILE].qv_grace = 0;
return 1;
default:
/* XXX sert errno and return -1 ? */
diff -r 26dca961760b -r 301a2dc2fb7d lib/libquota/getufsquota.c
--- a/lib/libquota/getufsquota.c Fri Nov 25 16:52:47 2011 +0000
+++ b/lib/libquota/getufsquota.c Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getufsquota.c,v 1.3 2011/09/30 22:08:19 jym Exp $ */
+/* $NetBSD: getufsquota.c,v 1.4 2011/11/25 16:55:05 dholland Exp $ */
/*-
* Copyright (c) 2011 Manuel Bouyer
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: getufsquota.c,v 1.3 2011/09/30 22:08:19 jym Exp $");
+__RCSID("$NetBSD: getufsquota.c,v 1.4 2011/11/25 16:55:05 dholland Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -42,7 +42,7 @@
/* retrieve quotas with ufs semantics from vfs, for the given user id */
int
-getufsquota(const char *mp, struct ufs_quota_entry *qv, uid_t id,
+getufsquota(const char *mp, struct quotaval *qv, uid_t id,
const char *class)
{
prop_dictionary_t dict, data, cmd;
@@ -151,9 +151,9 @@
goto end_dict;
}
values[QUOTA_LIMIT_BLOCK] =
- &qv[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit;
+ &qv[QUOTA_LIMIT_BLOCK].qv_hardlimit;
values[QUOTA_LIMIT_FILE] =
- &qv[QUOTA_LIMIT_FILE].ufsqe_hardlimit;
+ &qv[QUOTA_LIMIT_FILE].qv_hardlimit;
errno = proptoquota64(data, values, ufs_quota_entry_names,
UFS_QUOTA_NENTRIES, ufs_quota_limit_names, QUOTA_NLIMITS);
diff -r 26dca961760b -r 301a2dc2fb7d libexec/rpc.rquotad/rquotad.c
--- a/libexec/rpc.rquotad/rquotad.c Fri Nov 25 16:52:47 2011 +0000
+++ b/libexec/rpc.rquotad/rquotad.c Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rquotad.c,v 1.30 2011/09/16 16:13:17 plunky Exp $ */
+/* $NetBSD: rquotad.c,v 1.31 2011/11/25 16:55:05 dholland Exp $ */
/*
* by Manuel Bouyer (bouyer%ensta.fr@localhost). Public domain.
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: rquotad.c,v 1.30 2011/09/16 16:13:17 plunky Exp $");
+__RCSID("$NetBSD: rquotad.c,v 1.31 2011/11/25 16:55:05 dholland Exp $");
#endif
#include <sys/param.h>
@@ -170,7 +170,7 @@
struct getquota_args getq_args;
struct ext_getquota_args ext_getq_args;
struct getquota_rslt getq_rslt;
- struct ufs_quota_entry qe[QUOTA_NLIMITS];
+ struct quotaval qv[QUOTA_NLIMITS];
const char *class;
struct timeval timev;
@@ -209,7 +209,7 @@
if (request->rq_cred.oa_flavor != AUTH_UNIX) {
/* bad auth */
getq_rslt.status = Q_EPERM;
- } else if (!getufsquota(ext_getq_args.gqa_pathp, qe,
+ } else if (!getufsquota(ext_getq_args.gqa_pathp, qv,
ext_getq_args.gqa_id, class)) {
/* failed, return noquota */
getq_rslt.status = Q_NOQUOTA;
@@ -219,21 +219,21 @@
getq_rslt.getquota_rslt_u.gqr_rquota.rq_active = TRUE;
getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize = DEV_BSIZE;
getq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit =
- qlim2rqlim(qe[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit);
+ qlim2rqlim(qv[QUOTA_LIMIT_BLOCK].qv_hardlimit);
getq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit =
- qlim2rqlim(qe[QUOTA_LIMIT_BLOCK].ufsqe_softlimit);
+ qlim2rqlim(qv[QUOTA_LIMIT_BLOCK].qv_softlimit);
getq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks =
- qe[QUOTA_LIMIT_BLOCK].ufsqe_cur;
+ qv[QUOTA_LIMIT_BLOCK].qv_usage;
getq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit =
- qlim2rqlim(qe[QUOTA_LIMIT_FILE].ufsqe_hardlimit);
+ qlim2rqlim(qv[QUOTA_LIMIT_FILE].qv_hardlimit);
getq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit =
- qlim2rqlim(qe[QUOTA_LIMIT_FILE].ufsqe_softlimit);
+ qlim2rqlim(qv[QUOTA_LIMIT_FILE].qv_softlimit);
getq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles =
- qe[QUOTA_LIMIT_FILE].ufsqe_cur;
+ qv[QUOTA_LIMIT_FILE].qv_usage;
getq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft =
- qe[QUOTA_LIMIT_BLOCK].ufsqe_time - timev.tv_sec;
+ qv[QUOTA_LIMIT_BLOCK].qv_expiretime - timev.tv_sec;
getq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft =
- qe[QUOTA_LIMIT_FILE].ufsqe_time - timev.tv_sec;
+ qv[QUOTA_LIMIT_FILE].qv_expiretime - timev.tv_sec;
}
out:
if (!svc_sendreply(transp, (xdrproc_t)xdr_getquota_rslt, (char *)&getq_rslt))
diff -r 26dca961760b -r 301a2dc2fb7d sys/compat/common/vfs_syscalls_50.c
--- a/sys/compat/common/vfs_syscalls_50.c Fri Nov 25 16:52:47 2011 +0000
+++ b/sys/compat/common/vfs_syscalls_50.c Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_syscalls_50.c,v 1.9 2011/11/20 21:43:35 dholland Exp $ */
+/* $NetBSD: vfs_syscalls_50.c,v 1.10 2011/11/25 16:55:05 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.9 2011/11/20 21:43:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.10 2011/11/25 16:55:05 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -336,11 +336,11 @@
prop_array_t cmds, datas;
char *bufpath;
struct dqblk dqblk;
- struct ufs_quota_entry qe[QUOTA_NLIMITS];
+ struct quotaval qv[QUOTA_NLIMITS];
uint64_t *values[QUOTA_NLIMITS];
- values[QUOTA_LIMIT_BLOCK] = &qe[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit;
- values[QUOTA_LIMIT_FILE] = &qe[QUOTA_LIMIT_FILE].ufsqe_hardlimit;
+ values[QUOTA_LIMIT_BLOCK] = &qv[QUOTA_LIMIT_BLOCK].qv_hardlimit;
+ values[QUOTA_LIMIT_FILE] = &qv[QUOTA_LIMIT_FILE].qv_hardlimit;
error = namei_simple_user(SCARG(uap, path),
NSM_FOLLOW_TRYEMULROOT, &vp);
@@ -452,7 +452,7 @@
ufs_quota_limit_names, QUOTA_NLIMITS);
if (error)
goto out_dict;
- ufsqe2dqblk(qe, &dqblk);
+ quotaval_to_dqblk(qv, &dqblk);
error = copyout(&dqblk, SCARG(uap, arg), sizeof(dqblk));
goto out_dict;
@@ -460,7 +460,7 @@
error = copyin(SCARG(uap, arg), &dqblk, sizeof(dqblk));
if (error)
goto out_datas;
- dqblk2ufsqe(&dqblk, qe);
+ dqblk_to_quotaval(&dqblk, qv);
error = ENOMEM;
data = quota64toprop(SCARG(uap, uid), 0, values,
diff -r 26dca961760b -r 301a2dc2fb7d sys/sys/quota.h
--- a/sys/sys/quota.h Fri Nov 25 16:52:47 2011 +0000
+++ b/sys/sys/quota.h Fri Nov 25 16:55:05 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quota.h,v 1.5 2011/11/20 21:43:34 dholland Exp $ */
+/* $NetBSD: quota.h,v 1.6 2011/11/25 16:55:05 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@@ -28,13 +28,15 @@
#ifndef _SYS_QUOTA_H_
#define _SYS_QUOTA_H_
-/* structure used to describe a UFS-like quota entry */
-struct ufs_quota_entry {
- uint64_t ufsqe_hardlimit; /* absolute limit */
- uint64_t ufsqe_softlimit; /* overflowable limit */
- uint64_t ufsqe_cur; /* current usage */
- int64_t ufsqe_time; /* grace expiration date for softlimit overflow */
- int64_t ufsqe_grace; /* allowed time for softlimit overflow */
Home |
Main Index |
Thread Index |
Old Index