Whamcloud - gitweb
LU-14462 gss: fix support for namespace in lgss_keyring
[fs/lustre-release.git] / lustre / doc / llapi_quotactl.3
1 .TH LLAPI_QUOTACTL 3
2 .SH NAME
3 llapi_quotactl \- manipulate disk quotas on a Lustre filesystem
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .sp
8 .BI "int llapi_quotactl(char" " *mnt," " struct if_quotactl" " *qctl)
9 .sp
10 \fBstruct if_quotactl {
11         __u32                   qc_cmd;
12         __u32                   qc_type;
13         __u32                   qc_id;
14         __u32                   qc_stat;
15         struct obd_dqinfo       qc_dqinfo;
16         struct obd_dqblk        qc_dqblk;
17         char                    obd_type[16];
18         struct obd_uuid         obd_uuid;
19 };
20 .sp
21 \fBstruct obd_dqblk {
22         __u64 dqb_bhardlimit;
23         __u64 dqb_bsoftlimit;
24         __u64 dqb_curspace;
25         __u64 dqb_ihardlimit;
26         __u64 dqb_isoftlimit;
27         __u64 dqb_curinodes;
28         __u64 dqb_btime;
29         __u64 dqb_itime;
30         __u32 dqb_valid;
31         __u32 padding;
32 };
33 .sp
34 \fBstruct obd_dqinfo {
35         __u64 dqi_bgrace;
36         __u64 dqi_igrace;
37         __u32 dqi_flags;
38         __u32 dqi_valid;
39 };
40 .sp
41 \fBstruct obd_uuid {
42         char uuid[40];
43 };
44 .fi
45 .SH DESCRIPTION
46 .LP
47 .IX  "filesystem"  "quotactl() disk quotas"  ""  "\fLquotactl()\fP \(em disk quotas"
48 .IX  "quotactl() disk quotas"  ""  "\fLquotactl()\fP \(em disk quotas"
49 .IX  "disk quotas quotactl()"  ""  "disk quotas \(em \fLquotactl()\fP"
50 .LP
51 The
52 .B llapi_quotactl(\|)
53 function manipulates disk quotas on a Lustre filesystem
54 .I mnt.
55 .I qc_cmd
56 indicates a command to be applied to 
57 .SM UID
58 .IR qc_id
59 or 
60 .SM GID
61 .IR qc_id .
62 .TP 15
63 .SB LUSTRE_Q_QUOTAON
64 Turn on quotas for a Lustre filesystem. Deprecated as of 2.4.0.
65 .I qc_type
66 is USRQUOTA, GRPQUOTA or UGQUOTA (both user and group quotas).
67 The quota files must exist; they are normally created with the
68 .BR llapi_quotacheck (3)
69 call.
70
71 This call is restricted to the super-user.
72 .TP
73 .SB LUSTRE_Q_QUOTAOFF
74 Turn off quotas for a Lustre filesystem. Deprecated as of 2.4.0.
75 .I qc_type
76 is USRQUOTA, GRPQUOTA or UGQUOTA (both user and group quotas).
77
78 This call is restricted to the super-user.
79 .TP
80 .SB LUSTRE_Q_GETQUOTA
81 Get disk quota limits and current usage for user or group
82 .IR qc_id .
83 .I qc_type
84 is USRQUOTA or GRPQUOTA.
85 .I uuid
86 may be filled with OBD UUID string to query quota information from a specific node.
87 .I dqb_valid
88 may be set nonzero to query information only from MDS. If
89 .I uuid
90 is an empty string and
91 .I dqb_valid
92 is zero then clusterwide limits and usage are returned. On return
93 .I obd_dqblk
94 contains the requested information (block limits unit is kilobyte).
95 .I dqb_btime
96 and
97 .I dqb_itime
98 are block and inode softlimit grace period expiration timestamps for the requested user or group.
99
100 Quotas must be turned on before using this command.
101 .TP
102 .SB LUSTRE_Q_SETQUOTA
103 Set disk quota limits for user or group
104 .IR qc_id .
105 .I qc_type
106 is USRQUOTA or GRPQUOTA.
107 .I dqb_valid
108 must be set to QIF_ILIMITS, QIF_BLIMITS or QIF_LIMITS (both inode limits and block limits) dependent on updating limits.
109 .I obd_dqblk
110 must be filled with limits values (as set in
111 .I dqb_valid 
112 , block limits unit is kilobyte).
113
114 Quotas must be turned on before using this command.
115 .TP
116 .SB LUSTRE_Q_GETINFO
117 Get information about quotas.
118 .I qc_type
119 is either USRQUOTA or GRPQUOTA. On return
120 .I dqi_igrace
121 is the default inode grace period duration for all users or all groups (in seconds),
122 .I dqi_bgrace
123 is the default block grace period duration for all users or all groups (in seconds),
124 .I dqi_flags
125 is not used by the current Lustre version.
126 .TP
127 .SB LUSTRE_Q_SETINFO
128 Set quota information (like grace times).
129 .I qc_type
130 is either USRQUOTA or GRPQUOTA.
131 .I dqi_igrace
132 is inode grace time (in seconds),
133 .I dqi_bgrace
134 is block grace time (in seconds),
135 .I dqi_flags
136 is not used by the current Lustre version and must be zeroed.
137 .SH RETURN VALUES
138 .LP
139 .B llapi_quotactl(\|)
140 returns:
141 .TP
142 0
143 on success.
144 .TP
145 \-1
146 on failure and sets
147 .B errno
148 to indicate the error.
149 .SH ERRORS
150 .TP 15
151 .SM EFAULT
152 .I qctl
153 is invalid.
154 .TP
155 .SM ENOSYS
156 The kernel or Lustre modules have not been compiled with the
157 .SB QUOTA
158 option.
159 .TP
160 .SM ENOMEM
161 Insufficient memory to complete operation.
162 .TP
163 .SM ENOTTY
164 .I qc_cmd
165 is invalid.
166 .TP
167 .SM EBUSY
168 Cannot process during quotacheck.
169 .TP
170 .SM ENOENT
171 .I uuid
172 does not correspond to OBD or
173 .I mnt
174 does not exist
175 .TP
176 .SM EPERM
177 The call is privileged and the caller was not the super-user.
178 .TP
179 .SM ESRCH
180 No disc quota is found for the indicated user.
181 .IP
182 Quotas have not been turned on for this filesystem.
183 .SH "SEE ALSO"
184 .BR lfs (1),
185 .BR lustre (7),
186 .BR lustreapi (7)