Sun Jan 29 19:36:15 2012 UTC ()
Move the semantic restriction codes from sys/quotactl.h to
sys/quota.h; they're meant to be used by applications and were
stuffed into the wrong place by accident last week and got
committed that way yesterday.


(dholland)
diff -r1.10 -r1.11 src/sys/sys/quota.h
diff -r1.30 -r1.31 src/sys/sys/quotactl.h

cvs diff -r1.10 -r1.11 src/sys/sys/quota.h (expand / switch to unified diff)

--- src/sys/sys/quota.h 2012/01/29 06:43:34 1.10
+++ src/sys/sys/quota.h 2012/01/29 19:36:14 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: quota.h,v 1.10 2012/01/29 06:43:34 dholland Exp $ */ 1/* $NetBSD: quota.h,v 1.11 2012/01/29 19:36:14 dholland Exp $ */
2/*- 2/*-
3 * Copyright (c) 2010 Manuel Bouyer 3 * Copyright (c) 2010 Manuel Bouyer
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -37,26 +37,35 @@ @@ -37,26 +37,35 @@
37/* quota object types (things being limited) */ 37/* quota object types (things being limited) */
38#define QUOTA_OBJTYPE_BLOCKS 0 38#define QUOTA_OBJTYPE_BLOCKS 0
39#define QUOTA_OBJTYPE_FILES 1 39#define QUOTA_OBJTYPE_FILES 1
40 40
41/* id value for "default" */ 41/* id value for "default" */
42#define QUOTA_DEFAULTID ((id_t)-1) 42#define QUOTA_DEFAULTID ((id_t)-1)
43 43
44/* limit value for "no limit" */ 44/* limit value for "no limit" */
45#define QUOTA_NOLIMIT ((uint64_t)0xffffffffffffffffULL) 45#define QUOTA_NOLIMIT ((uint64_t)0xffffffffffffffffULL)
46 46
47/* time value for "no time" */ 47/* time value for "no time" */
48#define QUOTA_NOTIME ((time_t)-1) 48#define QUOTA_NOTIME ((time_t)-1)
49 49
 50/*
 51 * Semantic restrictions. These are hints applications can use
 52 * to help produce comprehensible error diagnostics when something
 53 * unsupported is attempted.
 54 */
 55#define QUOTA_RESTRICT_NEEDSQUOTACHECK 0x1 /* quotacheck(8) required */
 56#define QUOTA_RESTRICT_UNIFORMGRACE 0x2 /* grace time is global */
 57#define QUOTA_RESTRICT_32BIT 0x4 /* values limited to 2^32 */
 58
50 59
51/* 60/*
52 * Structure used to describe the key part of a quota record. 61 * Structure used to describe the key part of a quota record.
53 */ 62 */
54struct quotakey { 63struct quotakey {
55 int qk_idtype; /* type of id (user, group, etc.) */ 64 int qk_idtype; /* type of id (user, group, etc.) */
56 id_t qk_id; /* actual id number */ 65 id_t qk_id; /* actual id number */
57 int qk_objtype; /* type of fs object (blocks, files, etc.) */ 66 int qk_objtype; /* type of fs object (blocks, files, etc.) */
58}; 67};
59 68
60/* 69/*
61 * Structure used to describe the value part of a quota record. 70 * Structure used to describe the value part of a quota record.
62 */ 71 */

cvs diff -r1.30 -r1.31 src/sys/sys/quotactl.h (expand / switch to unified diff)

--- src/sys/sys/quotactl.h 2012/01/29 07:13:43 1.30
+++ src/sys/sys/quotactl.h 2012/01/29 19:36:14 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: quotactl.h,v 1.30 2012/01/29 07:13:43 dholland Exp $ */ 1/* $NetBSD: quotactl.h,v 1.31 2012/01/29 19:36:14 dholland Exp $ */
2/*- 2/*-
3 * Copyright (c) 2011 The NetBSD Foundation, Inc. 3 * Copyright (c) 2011 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by David A. Holland. 7 * by David A. Holland.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,41 +30,34 @@ @@ -30,41 +30,34 @@
30 30
31#ifndef _SYS_QUOTACTL_H_ 31#ifndef _SYS_QUOTACTL_H_
32#define _SYS_QUOTACTL_H_ 32#define _SYS_QUOTACTL_H_
33 33
34/* 34/*
35 * Note - this is an internal interface. Application code (and, 35 * Note - this is an internal interface. Application code (and,
36 * really, anything that isn't libquota or inside the kernel) should 36 * really, anything that isn't libquota or inside the kernel) should
37 * use the <quota.h> API instead. 37 * use the <quota.h> API instead.
38 */ 38 */
39 39
40/* Size of random quota strings */ 40/* Size of random quota strings */
41#define QUOTA_NAMELEN 32 41#define QUOTA_NAMELEN 32
42 42
43/* 
44 * Restrictions for qs_restrictions. 
45 */ 
46#define QUOTA_RESTRICT_NEEDSQUOTACHECK 0x1 /* quotacheck(8) required */ 
47#define QUOTA_RESTRICT_UNIFORMGRACE 0x2 /* grace time is global */ 
48#define QUOTA_RESTRICT_32BIT 0x4 /* values limited to 2^32 */ 
49  
50/*  43/*
51 * Structure for QUOTACTL_STAT. 44 * Structure for QUOTACTL_STAT.
52 */  45 */
53struct quotastat { 46struct quotastat {
54 char qs_implname[QUOTA_NAMELEN]; 47 char qs_implname[QUOTA_NAMELEN];
55 unsigned qs_numidtypes; 48 unsigned qs_numidtypes;
56 unsigned qs_numobjtypes; 49 unsigned qs_numobjtypes;
57 unsigned qs_restrictions; 50 unsigned qs_restrictions; /* semantic restriction codes */
58}; 51};
59  52
60/* 53/*
61 * Semi-opaque structure for cursors. This holds the cursor state in 54 * Semi-opaque structure for cursors. This holds the cursor state in
62 * userland; the size is exposed only to libquota, not to client code, 55 * userland; the size is exposed only to libquota, not to client code,
63 * and is meant to be large enough to accomodate all likely future 56 * and is meant to be large enough to accomodate all likely future
64 * expansion without being unduly bloated, as it will need to be 57 * expansion without being unduly bloated, as it will need to be
65 * copied in and out for every call using it. 58 * copied in and out for every call using it.
66 */ 59 */
67struct quotakcursor { 60struct quotakcursor {
68 union { 61 union {
69 char qkc_space[64]; 62 char qkc_space[64];
70 uintmax_t __qkc_forcealign; 63 uintmax_t __qkc_forcealign;