Module Name:    src
Committed By:   dholland
Date:           Wed Jan 25 01:22:57 UTC 2012

Modified Files:
        src/lib/libquota: quota_proplib.c quota_schema.c quotapvt.h

Log Message:
Move some more stuff technically specific to the proplib kernel
interface into the source file for using the proplib kernel interface.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libquota/quota_proplib.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/quota_schema.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libquota/quotapvt.h

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

Modified files:

Index: src/lib/libquota/quota_proplib.c
diff -u src/lib/libquota/quota_proplib.c:1.6 src/lib/libquota/quota_proplib.c:1.7
--- src/lib/libquota/quota_proplib.c:1.6	Mon Jan  9 15:43:19 2012
+++ src/lib/libquota/quota_proplib.c	Wed Jan 25 01:22:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: quota_proplib.c,v 1.6 2012/01/09 15:43:19 dholland Exp $	*/
+/*	$NetBSD: quota_proplib.c,v 1.7 2012/01/25 01:22:56 dholland Exp $	*/
 /*-
   * Copyright (c) 2011 Manuel Bouyer
   * All rights reserved.
@@ -26,7 +26,7 @@
   */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_proplib.c,v 1.6 2012/01/09 15:43:19 dholland Exp $");
+__RCSID("$NetBSD: quota_proplib.c,v 1.7 2012/01/25 01:22:56 dholland Exp $");
 
 #include <stdlib.h>
 #include <string.h>
@@ -180,6 +180,47 @@ __quota_proplib_getimplname(struct quota
 	return "unknown";
 }
 
+unsigned
+__quota_proplib_getnumidtypes(void)
+{
+	return QUOTA_NCLASS;
+}
+
+const char *
+__quota_proplib_idtype_getname(int idtype)
+{
+	if (idtype < 0 || idtype >= QUOTA_NCLASS) {
+		return NULL;
+	}
+	return ufs_quota_class_names[idtype];
+}
+
+unsigned
+__quota_proplib_getnumobjtypes(void)
+{
+	return QUOTA_NLIMITS;
+}
+
+const char *
+__quota_proplib_objtype_getname(int objtype)
+{
+	if (objtype < 0 || objtype >= QUOTA_NLIMITS) {
+		return NULL;
+	}
+	return ufs_quota_limit_names[objtype];
+}
+
+int
+__quota_proplib_objtype_isbytes(int objtype)
+{
+	switch (objtype) {
+		case QUOTA_LIMIT_BLOCK: return 1;
+		case QUOTA_LIMIT_FILE: return 0;
+		default: break;
+	}
+	return 0;
+}
+
 static int
 __quota_proplib_extractval(int objtype, prop_dictionary_t data,
 			   struct quotaval *qv)

Index: src/lib/libquota/quota_schema.c
diff -u src/lib/libquota/quota_schema.c:1.2 src/lib/libquota/quota_schema.c:1.3
--- src/lib/libquota/quota_schema.c:1.2	Mon Jan  9 15:34:34 2012
+++ src/lib/libquota/quota_schema.c	Wed Jan 25 01:22:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: quota_schema.c,v 1.2 2012/01/09 15:34:34 dholland Exp $	*/
+/*	$NetBSD: quota_schema.c,v 1.3 2012/01/25 01:22:57 dholland Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_schema.c,v 1.2 2012/01/09 15:34:34 dholland Exp $");
+__RCSID("$NetBSD: quota_schema.c,v 1.3 2012/01/25 01:22:57 dholland Exp $");
 
 #include <sys/types.h>
 #include <sys/statvfs.h>
@@ -38,7 +38,6 @@ __RCSID("$NetBSD: quota_schema.c,v 1.2 2
 #include <errno.h>
 
 #include <quota.h>
-#include <quota/quotaprop.h>
 #include "quotapvt.h"
 
 /*
@@ -60,44 +59,33 @@ quota_getimplname(struct quotahandle *qh
 unsigned
 quota_getnumidtypes(struct quotahandle *qh)
 {
-	return QUOTA_NCLASS;
+	return __quota_proplib_getnumidtypes();
 }
 
 /* ARGSUSED */
 const char *
 quota_idtype_getname(struct quotahandle *qh, int idtype)
 {
-	if (idtype < 0 || idtype >= QUOTA_NCLASS) {
-		return NULL;
-	}
-	return ufs_quota_class_names[idtype];
+	return __quota_proplib_idtype_getname(idtype);
 }
 
 /* ARGSUSED */
 unsigned
 quota_getnumobjtypes(struct quotahandle *qh)
 {
-	return QUOTA_NLIMITS;
+	return __quota_proplib_getnumobjtypes();
 }
 
 /* ARGSUSED */
 const char *
 quota_objtype_getname(struct quotahandle *qh, int objtype)
 {
-	if (objtype < 0 || objtype >= QUOTA_NLIMITS) {
-		return NULL;
-	}
-	return ufs_quota_limit_names[objtype];
+	return __quota_proplib_objtype_getname(objtype);
 }
 
 /* ARGSUSED */
 int
 quota_objtype_isbytes(struct quotahandle *qh, int objtype)
 {
-	switch (objtype) {
-		case QUOTA_LIMIT_BLOCK: return 1;
-		case QUOTA_LIMIT_FILE: return 0;
-		default: break;
-	}
-	return 0;
+	return __quota_proplib_objtype_isbytes(objtype);
 }

Index: src/lib/libquota/quotapvt.h
diff -u src/lib/libquota/quotapvt.h:1.8 src/lib/libquota/quotapvt.h:1.9
--- src/lib/libquota/quotapvt.h:1.8	Mon Jan  9 15:45:19 2012
+++ src/lib/libquota/quotapvt.h	Wed Jan 25 01:22:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: quotapvt.h,v 1.8 2012/01/09 15:45:19 dholland Exp $	*/
+/*	$NetBSD: quotapvt.h,v 1.9 2012/01/25 01:22:57 dholland Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -54,6 +54,11 @@ struct quotacursor {
 /* proplib kernel interface */
 int __quota_proplib_getversion(struct quotahandle *qh, int8_t *version_ret);
 const char *__quota_proplib_getimplname(struct quotahandle *);
+unsigned __quota_proplib_getnumidtypes(void);
+const char *__quota_proplib_idtype_getname(int idtype);
+unsigned __quota_proplib_getnumobjtypes(void);
+const char *__quota_proplib_objtype_getname(int objtype);
+int __quota_proplib_objtype_isbytes(int objtype);
 int __quota_proplib_get(struct quotahandle *qh, const struct quotakey *qk,
 			struct quotaval *qv);
 int __quota_proplib_put(struct quotahandle *qh, const struct quotakey *qk,

Reply via email to