]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Jan Kara <jack@suse.cz> |
2 | References: fate#302681 | |
3 | Subject: [PATCH 11/28] quota: Move quotaio_v[12].h from include/linux/ to fs/ | |
4 | Patch-mainline: 2.6.29? | |
5 | ||
6 | Since these include files are used only by implementation of quota formats, | |
7 | there's no need to have them in include/linux/. | |
8 | ||
9 | Signed-off-by: Jan Kara <jack@suse.cz> | |
10 | --- | |
11 | fs/quota_v1.c | 3 +- | |
12 | fs/quota_v2.c | 7 ++-- | |
13 | fs/quotaio_v1.h | 33 ++++++++++++++++++ | |
14 | fs/quotaio_v2.h | 79 ++++++++++++++++++++++++++++++++++++++++++++ | |
15 | include/linux/quotaio_v1.h | 33 ------------------ | |
16 | include/linux/quotaio_v2.h | 79 -------------------------------------------- | |
17 | 6 files changed, 118 insertions(+), 116 deletions(-) | |
18 | create mode 100644 fs/quotaio_v1.h | |
19 | create mode 100644 fs/quotaio_v2.h | |
20 | delete mode 100644 include/linux/quotaio_v1.h | |
21 | delete mode 100644 include/linux/quotaio_v2.h | |
22 | ||
23 | diff --git a/fs/quota_v1.c b/fs/quota_v1.c | |
24 | index 3e078ee..b4af1c6 100644 | |
25 | --- a/fs/quota_v1.c | |
26 | +++ b/fs/quota_v1.c | |
27 | @@ -3,13 +3,14 @@ | |
28 | #include <linux/quota.h> | |
29 | #include <linux/quotaops.h> | |
30 | #include <linux/dqblk_v1.h> | |
31 | -#include <linux/quotaio_v1.h> | |
32 | #include <linux/kernel.h> | |
33 | #include <linux/init.h> | |
34 | #include <linux/module.h> | |
35 | ||
36 | #include <asm/byteorder.h> | |
37 | ||
38 | +#include "quotaio_v1.h" | |
39 | + | |
40 | MODULE_AUTHOR("Jan Kara"); | |
41 | MODULE_DESCRIPTION("Old quota format support"); | |
42 | MODULE_LICENSE("GPL"); | |
43 | diff --git a/fs/quota_v2.c b/fs/quota_v2.c | |
44 | index 51c4717..a21d1a7 100644 | |
45 | --- a/fs/quota_v2.c | |
46 | +++ b/fs/quota_v2.c | |
47 | @@ -6,7 +6,6 @@ | |
48 | #include <linux/fs.h> | |
49 | #include <linux/mount.h> | |
50 | #include <linux/dqblk_v2.h> | |
51 | -#include <linux/quotaio_v2.h> | |
52 | #include <linux/kernel.h> | |
53 | #include <linux/init.h> | |
54 | #include <linux/module.h> | |
55 | @@ -15,6 +14,8 @@ | |
56 | ||
57 | #include <asm/byteorder.h> | |
58 | ||
59 | +#include "quotaio_v2.h" | |
60 | + | |
61 | MODULE_AUTHOR("Jan Kara"); | |
62 | MODULE_DESCRIPTION("Quota format v2 support"); | |
63 | MODULE_LICENSE("GPL"); | |
64 | @@ -129,8 +130,8 @@ static void mem2diskdqb(struct v2_disk_dqblk *d, struct mem_dqblk *m, qid_t id) | |
65 | d->dqb_isoftlimit = cpu_to_le32(m->dqb_isoftlimit); | |
66 | d->dqb_curinodes = cpu_to_le32(m->dqb_curinodes); | |
67 | d->dqb_itime = cpu_to_le64(m->dqb_itime); | |
68 | - d->dqb_bhardlimit = cpu_to_le32(v2_qbtos(m->dqb_bhardlimit)); | |
69 | - d->dqb_bsoftlimit = cpu_to_le32(v2_qbtos(m->dqb_bsoftlimit)); | |
70 | + d->dqb_bhardlimit = cpu_to_le32(v2_stoqb(m->dqb_bhardlimit)); | |
71 | + d->dqb_bsoftlimit = cpu_to_le32(v2_stoqb(m->dqb_bsoftlimit)); | |
72 | d->dqb_curspace = cpu_to_le64(m->dqb_curspace); | |
73 | d->dqb_btime = cpu_to_le64(m->dqb_btime); | |
74 | d->dqb_id = cpu_to_le32(id); | |
75 | diff --git a/fs/quotaio_v1.h b/fs/quotaio_v1.h | |
76 | new file mode 100644 | |
77 | index 0000000..746654b | |
78 | --- /dev/null | |
79 | +++ b/fs/quotaio_v1.h | |
80 | @@ -0,0 +1,33 @@ | |
81 | +#ifndef _LINUX_QUOTAIO_V1_H | |
82 | +#define _LINUX_QUOTAIO_V1_H | |
83 | + | |
84 | +#include <linux/types.h> | |
85 | + | |
86 | +/* | |
87 | + * The following constants define the amount of time given a user | |
88 | + * before the soft limits are treated as hard limits (usually resulting | |
89 | + * in an allocation failure). The timer is started when the user crosses | |
90 | + * their soft limit, it is reset when they go below their soft limit. | |
91 | + */ | |
92 | +#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ | |
93 | +#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ | |
94 | + | |
95 | +/* | |
96 | + * The following structure defines the format of the disk quota file | |
97 | + * (as it appears on disk) - the file is an array of these structures | |
98 | + * indexed by user or group number. | |
99 | + */ | |
100 | +struct v1_disk_dqblk { | |
101 | + __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | |
102 | + __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | |
103 | + __u32 dqb_curblocks; /* current block count */ | |
104 | + __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | |
105 | + __u32 dqb_isoftlimit; /* preferred inode limit */ | |
106 | + __u32 dqb_curinodes; /* current # allocated inodes */ | |
107 | + time_t dqb_btime; /* time limit for excessive disk use */ | |
108 | + time_t dqb_itime; /* time limit for excessive inode use */ | |
109 | +}; | |
110 | + | |
111 | +#define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk))) | |
112 | + | |
113 | +#endif /* _LINUX_QUOTAIO_V1_H */ | |
114 | diff --git a/fs/quotaio_v2.h b/fs/quotaio_v2.h | |
115 | new file mode 100644 | |
116 | index 0000000..303d7cb | |
117 | --- /dev/null | |
118 | +++ b/fs/quotaio_v2.h | |
119 | @@ -0,0 +1,79 @@ | |
120 | +/* | |
121 | + * Definitions of structures for vfsv0 quota format | |
122 | + */ | |
123 | + | |
124 | +#ifndef _LINUX_QUOTAIO_V2_H | |
125 | +#define _LINUX_QUOTAIO_V2_H | |
126 | + | |
127 | +#include <linux/types.h> | |
128 | +#include <linux/quota.h> | |
129 | + | |
130 | +/* | |
131 | + * Definitions of magics and versions of current quota files | |
132 | + */ | |
133 | +#define V2_INITQMAGICS {\ | |
134 | + 0xd9c01f11, /* USRQUOTA */\ | |
135 | + 0xd9c01927 /* GRPQUOTA */\ | |
136 | +} | |
137 | + | |
138 | +#define V2_INITQVERSIONS {\ | |
139 | + 0, /* USRQUOTA */\ | |
140 | + 0 /* GRPQUOTA */\ | |
141 | +} | |
142 | + | |
143 | +/* | |
144 | + * The following structure defines the format of the disk quota file | |
145 | + * (as it appears on disk) - the file is a radix tree whose leaves point | |
146 | + * to blocks of these structures. | |
147 | + */ | |
148 | +struct v2_disk_dqblk { | |
149 | + __le32 dqb_id; /* id this quota applies to */ | |
150 | + __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | |
151 | + __le32 dqb_isoftlimit; /* preferred inode limit */ | |
152 | + __le32 dqb_curinodes; /* current # allocated inodes */ | |
153 | + __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ | |
154 | + __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ | |
155 | + __le64 dqb_curspace; /* current space occupied (in bytes) */ | |
156 | + __le64 dqb_btime; /* time limit for excessive disk use */ | |
157 | + __le64 dqb_itime; /* time limit for excessive inode use */ | |
158 | +}; | |
159 | + | |
160 | +/* | |
161 | + * Here are header structures as written on disk and their in-memory copies | |
162 | + */ | |
163 | +/* First generic header */ | |
164 | +struct v2_disk_dqheader { | |
165 | + __le32 dqh_magic; /* Magic number identifying file */ | |
166 | + __le32 dqh_version; /* File version */ | |
167 | +}; | |
168 | + | |
169 | +/* Header with type and version specific information */ | |
170 | +struct v2_disk_dqinfo { | |
171 | + __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ | |
172 | + __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ | |
173 | + __le32 dqi_flags; /* Flags for quotafile (DQF_*) */ | |
174 | + __le32 dqi_blocks; /* Number of blocks in file */ | |
175 | + __le32 dqi_free_blk; /* Number of first free block in the list */ | |
176 | + __le32 dqi_free_entry; /* Number of block with at least one free entry */ | |
177 | +}; | |
178 | + | |
179 | +/* | |
180 | + * Structure of header of block with quota structures. It is padded to 16 bytes so | |
181 | + * there will be space for exactly 21 quota-entries in a block | |
182 | + */ | |
183 | +struct v2_disk_dqdbheader { | |
184 | + __le32 dqdh_next_free; /* Number of next block with free entry */ | |
185 | + __le32 dqdh_prev_free; /* Number of previous block with free entry */ | |
186 | + __le16 dqdh_entries; /* Number of valid entries in block */ | |
187 | + __le16 dqdh_pad1; | |
188 | + __le32 dqdh_pad2; | |
189 | +}; | |
190 | + | |
191 | +#define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ | |
192 | +#define V2_DQBLKSIZE_BITS 10 | |
193 | +#define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ | |
194 | +#define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ | |
195 | +#define V2_DQTREEDEPTH 4 /* Depth of quota tree */ | |
196 | +#define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ | |
197 | + | |
198 | +#endif /* _LINUX_QUOTAIO_V2_H */ | |
199 | diff --git a/include/linux/quotaio_v1.h b/include/linux/quotaio_v1.h | |
200 | deleted file mode 100644 | |
201 | index 746654b..0000000 | |
202 | --- a/include/linux/quotaio_v1.h | |
203 | +++ /dev/null | |
204 | @@ -1,33 +0,0 @@ | |
205 | -#ifndef _LINUX_QUOTAIO_V1_H | |
206 | -#define _LINUX_QUOTAIO_V1_H | |
207 | - | |
208 | -#include <linux/types.h> | |
209 | - | |
210 | -/* | |
211 | - * The following constants define the amount of time given a user | |
212 | - * before the soft limits are treated as hard limits (usually resulting | |
213 | - * in an allocation failure). The timer is started when the user crosses | |
214 | - * their soft limit, it is reset when they go below their soft limit. | |
215 | - */ | |
216 | -#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ | |
217 | -#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ | |
218 | - | |
219 | -/* | |
220 | - * The following structure defines the format of the disk quota file | |
221 | - * (as it appears on disk) - the file is an array of these structures | |
222 | - * indexed by user or group number. | |
223 | - */ | |
224 | -struct v1_disk_dqblk { | |
225 | - __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | |
226 | - __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | |
227 | - __u32 dqb_curblocks; /* current block count */ | |
228 | - __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | |
229 | - __u32 dqb_isoftlimit; /* preferred inode limit */ | |
230 | - __u32 dqb_curinodes; /* current # allocated inodes */ | |
231 | - time_t dqb_btime; /* time limit for excessive disk use */ | |
232 | - time_t dqb_itime; /* time limit for excessive inode use */ | |
233 | -}; | |
234 | - | |
235 | -#define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk))) | |
236 | - | |
237 | -#endif /* _LINUX_QUOTAIO_V1_H */ | |
238 | diff --git a/include/linux/quotaio_v2.h b/include/linux/quotaio_v2.h | |
239 | deleted file mode 100644 | |
240 | index 303d7cb..0000000 | |
241 | --- a/include/linux/quotaio_v2.h | |
242 | +++ /dev/null | |
243 | @@ -1,79 +0,0 @@ | |
244 | -/* | |
245 | - * Definitions of structures for vfsv0 quota format | |
246 | - */ | |
247 | - | |
248 | -#ifndef _LINUX_QUOTAIO_V2_H | |
249 | -#define _LINUX_QUOTAIO_V2_H | |
250 | - | |
251 | -#include <linux/types.h> | |
252 | -#include <linux/quota.h> | |
253 | - | |
254 | -/* | |
255 | - * Definitions of magics and versions of current quota files | |
256 | - */ | |
257 | -#define V2_INITQMAGICS {\ | |
258 | - 0xd9c01f11, /* USRQUOTA */\ | |
259 | - 0xd9c01927 /* GRPQUOTA */\ | |
260 | -} | |
261 | - | |
262 | -#define V2_INITQVERSIONS {\ | |
263 | - 0, /* USRQUOTA */\ | |
264 | - 0 /* GRPQUOTA */\ | |
265 | -} | |
266 | - | |
267 | -/* | |
268 | - * The following structure defines the format of the disk quota file | |
269 | - * (as it appears on disk) - the file is a radix tree whose leaves point | |
270 | - * to blocks of these structures. | |
271 | - */ | |
272 | -struct v2_disk_dqblk { | |
273 | - __le32 dqb_id; /* id this quota applies to */ | |
274 | - __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | |
275 | - __le32 dqb_isoftlimit; /* preferred inode limit */ | |
276 | - __le32 dqb_curinodes; /* current # allocated inodes */ | |
277 | - __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ | |
278 | - __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ | |
279 | - __le64 dqb_curspace; /* current space occupied (in bytes) */ | |
280 | - __le64 dqb_btime; /* time limit for excessive disk use */ | |
281 | - __le64 dqb_itime; /* time limit for excessive inode use */ | |
282 | -}; | |
283 | - | |
284 | -/* | |
285 | - * Here are header structures as written on disk and their in-memory copies | |
286 | - */ | |
287 | -/* First generic header */ | |
288 | -struct v2_disk_dqheader { | |
289 | - __le32 dqh_magic; /* Magic number identifying file */ | |
290 | - __le32 dqh_version; /* File version */ | |
291 | -}; | |
292 | - | |
293 | -/* Header with type and version specific information */ | |
294 | -struct v2_disk_dqinfo { | |
295 | - __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ | |
296 | - __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ | |
297 | - __le32 dqi_flags; /* Flags for quotafile (DQF_*) */ | |
298 | - __le32 dqi_blocks; /* Number of blocks in file */ | |
299 | - __le32 dqi_free_blk; /* Number of first free block in the list */ | |
300 | - __le32 dqi_free_entry; /* Number of block with at least one free entry */ | |
301 | -}; | |
302 | - | |
303 | -/* | |
304 | - * Structure of header of block with quota structures. It is padded to 16 bytes so | |
305 | - * there will be space for exactly 21 quota-entries in a block | |
306 | - */ | |
307 | -struct v2_disk_dqdbheader { | |
308 | - __le32 dqdh_next_free; /* Number of next block with free entry */ | |
309 | - __le32 dqdh_prev_free; /* Number of previous block with free entry */ | |
310 | - __le16 dqdh_entries; /* Number of valid entries in block */ | |
311 | - __le16 dqdh_pad1; | |
312 | - __le32 dqdh_pad2; | |
313 | -}; | |
314 | - | |
315 | -#define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ | |
316 | -#define V2_DQBLKSIZE_BITS 10 | |
317 | -#define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ | |
318 | -#define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ | |
319 | -#define V2_DQTREEDEPTH 4 /* Depth of quota tree */ | |
320 | -#define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ | |
321 | - | |
322 | -#endif /* _LINUX_QUOTAIO_V2_H */ | |
323 | -- | |
324 | 1.5.2.4 | |
325 |