comparison src/plugins/quota/rquota.x @ 8892:66a8cbe7f007 HEAD

quota-fs: Added support for NFS group quota. Based on patch by fandorin at rol.ru.
author Timo Sirainen <tss@iki.fi>
date Thu, 02 Apr 2009 15:02:58 -0400
parents
children
comparison
equal deleted inserted replaced
8891:fbb2343b85d9 8892:66a8cbe7f007
1 /* @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC */
2 /* @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro */
3
4 /*
5 * Remote quota protocol
6 * Requires unix authentication
7 */
8
9 const RQ_PATHLEN = 1024;
10
11 struct sq_dqblk {
12 unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */
13 unsigned int rq_bsoftlimit; /* preferred limit on disk blks */
14 unsigned int rq_curblocks; /* current block count */
15 unsigned int rq_fhardlimit; /* absolute limit on allocated files */
16 unsigned int rq_fsoftlimit; /* preferred file limit */
17 unsigned int rq_curfiles; /* current # allocated files */
18 unsigned int rq_btimeleft; /* time left for excessive disk use */
19 unsigned int rq_ftimeleft; /* time left for excessive files */
20 };
21
22 struct getquota_args {
23 string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
24 int gqa_uid; /* Inquire about quota for uid */
25 };
26
27 struct setquota_args {
28 int sqa_qcmd;
29 string sqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
30 int sqa_id; /* Set quota for uid */
31 sq_dqblk sqa_dqblk;
32 };
33
34 struct ext_getquota_args {
35 string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
36 int gqa_type; /* Type of quota info is needed about */
37 int gqa_id; /* Inquire about quota for id */
38 };
39
40 struct ext_setquota_args {
41 int sqa_qcmd;
42 string sqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
43 int sqa_id; /* Set quota for id */
44 int sqa_type; /* Type of quota to set */
45 sq_dqblk sqa_dqblk;
46 };
47
48 /*
49 * remote quota structure
50 */
51 struct rquota {
52 int rq_bsize; /* block size for block counts */
53 bool rq_active; /* indicates whether quota is active */
54 unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */
55 unsigned int rq_bsoftlimit; /* preferred limit on disk blks */
56 unsigned int rq_curblocks; /* current block count */
57 unsigned int rq_fhardlimit; /* absolute limit on allocated files */
58 unsigned int rq_fsoftlimit; /* preferred file limit */
59 unsigned int rq_curfiles; /* current # allocated files */
60 unsigned int rq_btimeleft; /* time left for excessive disk use */
61 unsigned int rq_ftimeleft; /* time left for excessive files */
62 };
63
64 enum qr_status {
65 Q_OK = 1, /* quota returned */
66 Q_NOQUOTA = 2, /* noquota for uid */
67 Q_EPERM = 3 /* no permission to access quota */
68 };
69
70 union getquota_rslt switch (qr_status status) {
71 case Q_OK:
72 rquota gqr_rquota; /* valid if status == Q_OK */
73 case Q_NOQUOTA:
74 void;
75 case Q_EPERM:
76 void;
77 };
78
79 union setquota_rslt switch (qr_status status) {
80 case Q_OK:
81 rquota sqr_rquota; /* valid if status == Q_OK */
82 case Q_NOQUOTA:
83 void;
84 case Q_EPERM:
85 void;
86 };
87
88 program RQUOTAPROG {
89 version RQUOTAVERS {
90 /*
91 * Get all quotas
92 */
93 getquota_rslt
94 RQUOTAPROC_GETQUOTA(getquota_args) = 1;
95
96 /*
97 * Get active quotas only
98 */
99 getquota_rslt
100 RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
101
102 /*
103 * Set all quotas
104 */
105 setquota_rslt
106 RQUOTAPROC_SETQUOTA(setquota_args) = 3;
107
108 /*
109 * Get active quotas only
110 */
111 setquota_rslt
112 RQUOTAPROC_SETACTIVEQUOTA(setquota_args) = 4;
113 } = 1;
114 version EXT_RQUOTAVERS {
115 /*
116 * Get all quotas
117 */
118 getquota_rslt
119 RQUOTAPROC_GETQUOTA(ext_getquota_args) = 1;
120
121 /*
122 * Get active quotas only
123 */
124 getquota_rslt
125 RQUOTAPROC_GETACTIVEQUOTA(ext_getquota_args) = 2;
126
127 /*
128 * Set all quotas
129 */
130 setquota_rslt
131 RQUOTAPROC_SETQUOTA(ext_setquota_args) = 3;
132
133 /*
134 * Set active quotas only
135 */
136 setquota_rslt
137 RQUOTAPROC_SETACTIVEQUOTA(ext_setquota_args) = 4;
138 } = 2;
139 } = 100011;