Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Reshuffle decls among the quota headers so everything is in ...



details:   https://anonhg.NetBSD.org/src/rev/612d1ac8226a
branches:  trunk
changeset: 771440:612d1ac8226a
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Nov 20 21:43:34 2011 +0000

description:
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.

diffstat:

 common/include/quota/quota.h        |  21 +++++++----
 common/include/quota/quotaprop.h    |  64 +++++++++++++++++++++---------------
 lib/libquota/getnfsquota.c          |   5 +-
 sys/compat/common/vfs_syscalls_50.c |  11 +++--
 sys/sys/quota.h                     |  30 +++++------------
 sys/ufs/ufs/quota1.h                |   4 +-
 sys/ufs/ufs/quota1_subr.c           |   5 +-
 7 files changed, 75 insertions(+), 65 deletions(-)

diffs (282 lines):

diff -r ad028ff1b796 -r 612d1ac8226a common/include/quota/quota.h
--- a/common/include/quota/quota.h      Sun Nov 20 21:27:26 2011 +0000
+++ b/common/include/quota/quota.h      Sun Nov 20 21:43:34 2011 +0000
@@ -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>
 
-/* 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 */
+/*
+ * Return codes for quota_check_limit()
+ */
+
 #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 @@
 #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 @@
 /* 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_ */
diff -r ad028ff1b796 -r 612d1ac8226a common/include/quota/quotaprop.h
--- a/common/include/quota/quotaprop.h  Sun Nov 20 21:27:26 2011 +0000
+++ b/common/include/quota/quotaprop.h  Sun Nov 20 21:43:34 2011 +0000
@@ -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>
+#ifndef _QUOTA_QUOTAPROP_H_
+#define _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);
+#include <prop/proplib.h>
+
+/* 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);
-
-prop_dictionary_t limits64toprop(uint64_t[], const char *[], int);
-prop_dictionary_t quota64toprop(uid_t, int, uint64_t *[], const char *[], int,
-    const char *[], int);
+/* strings used in dictionary for the different limit types */
+#define QUOTADICT_LTYPE_BLOCK "block"
+#define QUOTADICT_LTYPE_FILE "file"
 
-/* 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 @@
 #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_ */
diff -r ad028ff1b796 -r 612d1ac8226a lib/libquota/getnfsquota.c
--- a/lib/libquota/getnfsquota.c        Sun Nov 20 21:27:26 2011 +0000
+++ b/lib/libquota/getnfsquota.c        Sun Nov 20 21:43:34 2011 +0000
@@ -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 @@
 #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 @@
 #include <unistd.h>
 
 #include <quota/quota.h>
+#include <quota/quotaprop.h>
 
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
diff -r ad028ff1b796 -r 612d1ac8226a sys/compat/common/vfs_syscalls_50.c
--- a/sys/compat/common/vfs_syscalls_50.c       Sun Nov 20 21:27:26 2011 +0000
+++ b/sys/compat/common/vfs_syscalls_50.c       Sun Nov 20 21:43:34 2011 +0000
@@ -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 @@
 
 #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 @@
            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)
diff -r ad028ff1b796 -r 612d1ac8226a sys/sys/quota.h
--- a/sys/sys/quota.h   Sun Nov 20 21:27:26 2011 +0000
+++ b/sys/sys/quota.h   Sun Nov 20 21:43:34 2011 +0000
@@ -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_ */
diff -r ad028ff1b796 -r 612d1ac8226a sys/ufs/ufs/quota1.h
--- a/sys/ufs/ufs/quota1.h      Sun Nov 20 21:27:26 2011 +0000
+++ b/sys/ufs/ufs/quota1.h      Sun Nov 20 21:43:34 2011 +0000
@@ -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>
 
 /*
diff -r ad028ff1b796 -r 612d1ac8226a sys/ufs/ufs/quota1_subr.c
--- a/sys/ufs/ufs/quota1_subr.c Sun Nov 20 21:27:26 2011 +0000
+++ b/sys/ufs/ufs/quota1_subr.c Sun Nov 20 21:43:34 2011 +0000
@@ -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>
 



Home | Main Index | Thread Index | Old Index