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?
6 Since these include files are used only by implementation of quota formats,
7 there's no need to have them in include/linux/.
9 Signed-off-by: Jan Kara <jack@suse.cz>
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
23 diff --git a/fs/quota_v1.c b/fs/quota_v1.c
24 index 3e078ee..b4af1c6 100644
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>
36 #include <asm/byteorder.h>
38 +#include "quotaio_v1.h"
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
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>
57 #include <asm/byteorder.h>
59 +#include "quotaio_v2.h"
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
77 index 0000000..746654b
81 +#ifndef _LINUX_QUOTAIO_V1_H
82 +#define _LINUX_QUOTAIO_V1_H
84 +#include <linux/types.h>
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.
92 +#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
93 +#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
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.
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 */
111 +#define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk)))
113 +#endif /* _LINUX_QUOTAIO_V1_H */
114 diff --git a/fs/quotaio_v2.h b/fs/quotaio_v2.h
116 index 0000000..303d7cb
118 +++ b/fs/quotaio_v2.h
121 + * Definitions of structures for vfsv0 quota format
124 +#ifndef _LINUX_QUOTAIO_V2_H
125 +#define _LINUX_QUOTAIO_V2_H
127 +#include <linux/types.h>
128 +#include <linux/quota.h>
131 + * Definitions of magics and versions of current quota files
133 +#define V2_INITQMAGICS {\
134 + 0xd9c01f11, /* USRQUOTA */\
135 + 0xd9c01927 /* GRPQUOTA */\
138 +#define V2_INITQVERSIONS {\
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.
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 */
161 + * Here are header structures as written on disk and their in-memory copies
163 +/* First generic header */
164 +struct v2_disk_dqheader {
165 + __le32 dqh_magic; /* Magic number identifying file */
166 + __le32 dqh_version; /* File version */
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 */
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
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 */
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 */
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
205 -#ifndef _LINUX_QUOTAIO_V1_H
206 -#define _LINUX_QUOTAIO_V1_H
208 -#include <linux/types.h>
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.
216 -#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */
217 -#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */
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.
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 */
235 -#define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk)))
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
245 - * Definitions of structures for vfsv0 quota format
248 -#ifndef _LINUX_QUOTAIO_V2_H
249 -#define _LINUX_QUOTAIO_V2_H
251 -#include <linux/types.h>
252 -#include <linux/quota.h>
255 - * Definitions of magics and versions of current quota files
257 -#define V2_INITQMAGICS {\
258 - 0xd9c01f11, /* USRQUOTA */\
259 - 0xd9c01927 /* GRPQUOTA */\
262 -#define V2_INITQVERSIONS {\
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.
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 */
285 - * Here are header structures as written on disk and their in-memory copies
287 -/* First generic header */
288 -struct v2_disk_dqheader {
289 - __le32 dqh_magic; /* Magic number identifying file */
290 - __le32 dqh_version; /* File version */
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 */
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
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 */
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 */
322 -#endif /* _LINUX_QUOTAIO_V2_H */