summaryrefslogtreecommitdiff
path: root/quota.h
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2002-03-27 16:21:26 +0000
committerjkar8572 <jkar8572>2002-03-27 16:21:26 +0000
commit5975341695e27f23f5a58758954d1ea31c2d0d25 (patch)
tree5bb3bac1bdc313edffa6552867c8954a5dfeaac7 /quota.h
parenta40b9d8688fe0f1f34c70a986d3e408273fed14e (diff)
Fixed bug in quota(1) return code.
Rewritten detection of kernel version. Added support for generic interface for both quota formats in kernel.
Diffstat (limited to 'quota.h')
-rw-r--r--quota.h66
1 files changed, 62 insertions, 4 deletions
diff --git a/quota.h b/quota.h
index 9b4b424..a39a9ae 100644
--- a/quota.h
+++ b/quota.h
@@ -46,9 +46,68 @@ typedef u_int64_t qsize_t; /* Type in which we store size limitations */
#define SUBCMDSHIFT 8
#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
-#define Q_QUOTAON 0x0100 /* enable quotas */
-#define Q_QUOTAOFF 0x0200 /* disable quotas */
-#define Q_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
+#define Q_6_5_QUOTAON 0x0100 /* enable quotas */
+#define Q_6_5_QUOTAOFF 0x0200 /* disable quotas */
+#define Q_6_5_SYNC 0x0600 /* sync disk copy of a filesystems quotas */
+
+#define Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */
+#define Q_QUOTAON 0x800002 /* turn quotas on */
+#define Q_QUOTAOFF 0x800003 /* turn quotas off */
+#define Q_GETFMT 0x800004 /* get quota format used on given filesystem */
+#define Q_GETINFO 0x800005 /* get information about quota files */
+#define Q_SETINFO 0x800006 /* set information about quota files */
+#define Q_GETQUOTA 0x800007 /* get user quota structure */
+#define Q_SETQUOTA 0x800008 /* set user quota structure */
+
+/*
+ * Quota structure used for communication with userspace via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+#define QIF_BLIMITS 1
+#define QIF_SPACE 2
+#define QIF_ILIMITS 4
+#define QIF_INODES 8
+#define QIF_BTIME 16
+#define QIF_ITIME 32
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct if_dqblk {
+ u_int64_t dqb_bhardlimit;
+ u_int64_t dqb_bsoftlimit;
+ u_int64_t dqb_curspace;
+ u_int64_t dqb_ihardlimit;
+ u_int64_t dqb_isoftlimit;
+ u_int64_t dqb_curinodes;
+ u_int64_t dqb_btime;
+ u_int64_t dqb_itime;
+ u_int32_t dqb_valid;
+};
+
+/*
+ * Structure used for setting quota information about file via quotactl
+ * Following flags are used to specify which fields are valid
+ */
+#define IIF_BGRACE 1
+#define IIF_IGRACE 2
+#define IIF_FLAGS 4
+#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct if_dqinfo {
+ u_int64_t dqi_bgrace;
+ u_int64_t dqi_igrace;
+ u_int32_t dqi_flags;
+ u_int32_t dqi_valid;
+};
+
+/* Quota format identifiers */
+#define QFMT_VFS_OLD 1
+#define QFMT_VFS_V0 2
+
+/* Flags supported by kernel */
+#define V1_DQF_RSQUASH 1
/* Ioctl for getting quota size */
#include <sys/ioctl.h>
@@ -64,7 +123,6 @@ typedef u_int64_t qsize_t; /* Type in which we store size limitations */
#endif
#endif
-
long quotactl __P((int, const char *, qid_t, caddr_t));
#endif /* _QUOTA_ */