Module Name:    src
Committed By:   dholland
Date:           Sun Nov 20 21:43:35 UTC 2011

Modified Files:
        src/common/include/quota: quota.h quotaprop.h
        src/lib/libquota: getnfsquota.c
        src/sys/compat/common: vfs_syscalls_50.c
        src/sys/sys: quota.h
        src/sys/ufs/ufs: quota1.h quota1_subr.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/include/quota/quota.h \
    src/common/include/quota/quotaprop.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/getnfsquota.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/vfs_syscalls_50.c
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/quota.h
cvs rdiff -u -r1.3 -r1.4 src/sys/ufs/ufs/quota1.h
cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/ufs/quota1_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/include/quota/quota.h
diff -u src/common/include/quota/quota.h:1.2 src/common/include/quota/quota.h:1.3
--- src/common/include/quota/quota.h:1.2	Tue Jun  7 14:56:12 2011
+++ src/common/include/quota/quota.h	Sun Nov 20 21:43:34 2011
@@ -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
+#ifndef _QUOTA_QUOTA_H_
+#define _QUOTA_QUOTA_H_
+
 #include <sys/types.h>
-#include <quota/quotaprop.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
 #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
 /* 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_ */
Index: src/common/include/quota/quotaprop.h
diff -u src/common/include/quota/quotaprop.h:1.2 src/common/include/quota/quotaprop.h:1.3
--- src/common/include/quota/quotaprop.h:1.2	Tue Jun  7 14:56:12 2011
+++ src/common/include/quota/quotaprop.h	Sun Nov 20 21:43:34 2011
@@ -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
-#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);
+#ifndef _QUOTA_QUOTAPROP_H_
+#define _QUOTA_QUOTAPROP_H_
 
-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);
+#include <prop/proplib.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 */
-};
+/* 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"
 
 /* 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_ */

Index: src/lib/libquota/getnfsquota.c
diff -u src/lib/libquota/getnfsquota.c:1.2 src/lib/libquota/getnfsquota.c:1.3
--- src/lib/libquota/getnfsquota.c:1.2	Tue Aug 30 17:06:20 2011
+++ src/lib/libquota/getnfsquota.c	Sun Nov 20 21:43:35 2011
@@ -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, 19
 #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 20
 #include <unistd.h>
 
 #include <quota/quota.h>
+#include <quota/quotaprop.h>
 
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>

Index: src/sys/compat/common/vfs_syscalls_50.c
diff -u src/sys/compat/common/vfs_syscalls_50.c:1.8 src/sys/compat/common/vfs_syscalls_50.c:1.9
--- src/sys/compat/common/vfs_syscalls_50.c:1.8	Thu Mar 24 17:05:44 2011
+++ src/sys/compat/common/vfs_syscalls_50.c	Sun Nov 20 21:43:35 2011
@@ -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
 
 #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)

Index: src/sys/sys/quota.h
diff -u src/sys/sys/quota.h:1.4 src/sys/sys/quota.h:1.5
--- src/sys/sys/quota.h:1.4	Tue Jun  7 14:56:13 2011
+++ src/sys/sys/quota.h	Sun Nov 20 21:43:34 2011
@@ -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_ */

Index: src/sys/ufs/ufs/quota1.h
diff -u src/sys/ufs/ufs/quota1.h:1.3 src/sys/ufs/ufs/quota1.h:1.4
--- src/sys/ufs/ufs/quota1.h:1.3	Thu Mar 24 17:05:45 2011
+++ src/sys/ufs/ufs/quota1.h	Sun Nov 20 21:43:35 2011
@@ -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>
 
 /*

Index: src/sys/ufs/ufs/quota1_subr.c
diff -u src/sys/ufs/ufs/quota1_subr.c:1.4 src/sys/ufs/ufs/quota1_subr.c:1.5
--- src/sys/ufs/ufs/quota1_subr.c:1.4	Tue Jun  7 14:56:13 2011
+++ src/sys/ufs/ufs/quota1_subr.c	Sun Nov 20 21:43:35 2011
@@ -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>
 

Reply via email to