Reshuffle decls among the quota headers so everything is in the place

it should be:
   - stuff for the proplib interface goes in <quota/quotaprop.h>
   - stuff for userlevel only goes in <quota/quota.h>
   - stuff shared between user and kernel goes in <sys/quota.h>

Note that <quota/quota.h> and <quota/quotaprop.h> are expected to be
moved or removed later on... one thing at a time.

Update include directives in other files as needed.
This commit is contained in:
dholland 2011-11-20 21:43:34 +00:00
parent 0131e55685
commit c60360c18d
7 changed files with 75 additions and 65 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: quota.h,v 1.2 2011/06/07 14:56:12 bouyer Exp $ */
/* $NetBSD: quota.h,v 1.3 2011/11/20 21:43:34 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@ -25,14 +25,16 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QUOTA_QUOTA_H
#define _QUOTA_QUOTA_H
#include <sys/types.h>
#include <quota/quotaprop.h>
#ifndef _QUOTA_QUOTA_H_
#define _QUOTA_QUOTA_H_
#include <sys/types.h>
#include <sys/quota.h>
/*
* Return codes for quota_check_limit()
*/
/* check a quota usage against limits (assumes UFS semantic) */
int quota_check_limit(uint64_t, uint64_t, uint64_t, uint64_t, time_t, time_t);
/* return values for above */
#define QL_S_ALLOW_OK 0x00 /* below soft limit */
#define QL_S_ALLOW_SOFT 0x01 /* over soft limit */
#define QL_S_DENY_GRACE 0x02 /* over soft limit, grace time expired */
@ -43,6 +45,9 @@ int quota_check_limit(uint64_t, uint64_t, uint64_t, uint64_t, time_t, time_t);
#define QL_STATUS(x) ((x) & 0x0f)
#define QL_FLAGS(x) ((x) & 0xf0)
/* check a quota usage against limits (assumes UFS semantic) */
int quota_check_limit(uint64_t, uint64_t, uint64_t, uint64_t, time_t, time_t);
/*
* 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
@ -56,4 +61,4 @@ int getnfsquota(const char *, struct ufs_quota_entry *, 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 *);
#endif /* _QUOTA_QUOTA_H */
#endif /* _QUOTA_QUOTA_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: quotaprop.h,v 1.2 2011/06/07 14:56:12 bouyer Exp $ */
/* $NetBSD: quotaprop.h,v 1.3 2011/11/20 21:43:34 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@ -25,33 +25,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QUOTA_QUOTAPROP_H
#define _QUOTA_QUOTAPROP_H
#ifndef _QUOTA_QUOTAPROP_H_
#define _QUOTA_QUOTAPROP_H_
#include <prop/proplib.h>
#include <sys/quota.h>
int quotaprop_dict_get_uint64(prop_dictionary_t, uint64_t[],
const char *[], int, bool);
int proptoquota64(prop_dictionary_t, uint64_t *[], const char *[], int,
const char *[], int);
/* strings used in dictionary for the different quota class */
#define QUOTADICT_CLASS_USER "user"
#define QUOTADICT_CLASS_GROUP "group"
int quota_get_cmds(prop_dictionary_t, prop_array_t *);
prop_dictionary_t quota_prop_create(void);
bool quota_prop_add_command(prop_array_t, const char *, const char *,
prop_array_t);
/* strings used in dictionary for the different limit types */
#define QUOTADICT_LTYPE_BLOCK "block"
#define QUOTADICT_LTYPE_FILE "file"
prop_dictionary_t limits64toprop(uint64_t[], const char *[], int);
prop_dictionary_t quota64toprop(uid_t, int, uint64_t *[], const char *[], int,
const char *[], int);
/* 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 */
};
/* strings used in dictionary for the different limit and usage values */
#define QUOTADICT_LIMIT_SOFT "soft"
#define QUOTADICT_LIMIT_HARD "hard"
#define QUOTADICT_LIMIT_GTIME "grace time"
#define QUOTADICT_LIMIT_USAGE "usage"
#define QUOTADICT_LIMIT_ETIME "expire time"
/* array of strings for the above */
#define UFS_QUOTA_ENTRY_NAMES \
@ -78,4 +70,24 @@ extern const char *ufs_quota_class_names[];
#define QUOTA_NCLASS 2
#define QUOTA_CLASS_NAMES { QUOTADICT_CLASS_USER, QUOTADICT_CLASS_GROUP }
#endif /* _QUOTA_QUOTAPROP_H */
int quotaprop_dict_get_uint64(prop_dictionary_t, uint64_t[],
const char *[], int, bool);
int proptoquota64(prop_dictionary_t, uint64_t *[], const char *[], int,
const char *[], int);
int quota_get_cmds(prop_dictionary_t, prop_array_t *);
prop_dictionary_t quota_prop_create(void);
bool quota_prop_add_command(prop_array_t, const char *, const char *,
prop_array_t);
prop_dictionary_t limits64toprop(uint64_t[], const char *[], int);
prop_dictionary_t quota64toprop(uid_t, int, uint64_t *[], const char *[], int,
const char *[], int);
#if !defined(_KERNEL) && !defined(_STANDALONE)
__BEGIN_DECLS
int quotactl(const char *, struct plistref *) __RENAME(__quotactl50);
__END_DECLS
#endif
#endif /* _QUOTA_QUOTAPROP_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: getnfsquota.c,v 1.2 2011/08/30 17:06:20 plunky Exp $ */
/* $NetBSD: getnfsquota.c,v 1.3 2011/11/20 21:43:35 dholland Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1990, 1993\
#if 0
static char sccsid[] = "@(#)quota.c 8.4 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: getnfsquota.c,v 1.2 2011/08/30 17:06:20 plunky Exp $");
__RCSID("$NetBSD: getnfsquota.c,v 1.3 2011/11/20 21:43:35 dholland Exp $");
#endif
#endif /* not lint */
@ -64,6 +64,7 @@ __RCSID("$NetBSD: getnfsquota.c,v 1.2 2011/08/30 17:06:20 plunky Exp $");
#include <unistd.h>
#include <quota/quota.h>
#include <quota/quotaprop.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_syscalls_50.c,v 1.8 2011/03/24 17:05:44 bouyer Exp $ */
/* $NetBSD: vfs_syscalls_50.c,v 1.9 2011/11/20 21:43:35 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.8 2011/03/24 17:05:44 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.9 2011/11/20 21:43:35 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -62,6 +62,10 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.8 2011/03/24 17:05:44 bouyer E
#include <ufs/lfs/lfs_extern.h>
#include <sys/quota.h>
#include <quota/quotaprop.h>
#include <ufs/ufs/quota1.h>
#include <compat/common/compat_util.h>
#include <compat/sys/time.h>
#include <compat/sys/stat.h>
@ -313,9 +317,6 @@ compat_50_sys_mknod(struct lwp *l,
SCARG(uap, dev), retval, UIO_USERSPACE);
}
#include <ufs/ufs/quota1.h>
#include <quota/quotaprop.h>
/* ARGSUSED */
int
compat_50_sys_quotactl(struct lwp *l, const struct compat_50_sys_quotactl_args *uap, register_t *retval)

View File

@ -1,4 +1,4 @@
/* $NetBSD: quota.h,v 1.4 2011/06/07 14:56:13 bouyer Exp $ */
/* $NetBSD: quota.h,v 1.5 2011/11/20 21:43:34 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@ -28,25 +28,13 @@
#ifndef _SYS_QUOTA_H_
#define _SYS_QUOTA_H_
#if !defined(_KERNEL) && !defined(_STANDALONE)
__BEGIN_DECLS
int quotactl(const char *, struct plistref *) __RENAME(__quotactl50);
__END_DECLS
#endif
/* strings used in dictionary for the different quota class */
#define QUOTADICT_CLASS_USER "user"
#define QUOTADICT_CLASS_GROUP "group"
/* strings used in dictionary for the different limit types */
#define QUOTADICT_LTYPE_BLOCK "block"
#define QUOTADICT_LTYPE_FILE "file"
/* strings used in dictionary for the different limit and usage values */
#define QUOTADICT_LIMIT_SOFT "soft"
#define QUOTADICT_LIMIT_HARD "hard"
#define QUOTADICT_LIMIT_GTIME "grace time"
#define QUOTADICT_LIMIT_USAGE "usage"
#define QUOTADICT_LIMIT_ETIME "expire time"
/* 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 */
};
#endif /* _SYS_QUOTA_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: quota1.h,v 1.3 2011/03/24 17:05:45 bouyer Exp $ */
/* $NetBSD: quota1.h,v 1.4 2011/11/20 21:43:35 dholland Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -36,6 +36,8 @@
#ifndef _UFS_UFS_QUOTA1_H_
#define _UFS_UFS_QUOTA1_H_
#include <sys/quota.h>
#include <ufs/ufs/quota.h>
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: quota1_subr.c,v 1.4 2011/06/07 14:56:13 bouyer Exp $ */
/* $NetBSD: quota1_subr.c,v 1.5 2011/11/20 21:43:35 dholland Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@ -26,11 +26,12 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: quota1_subr.c,v 1.4 2011/06/07 14:56:13 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: quota1_subr.c,v 1.5 2011/11/20 21:43:35 dholland Exp $");
#include <sys/types.h>
#include <machine/limits.h>
#include <sys/quota.h>
#include <quota/quotaprop.h>
#include <ufs/ufs/quota1.h>