2 * Lustre administrative quota format
5 * include/linux/quotaio_v2.h
7 #ifndef _LUSTRE_QUOTA_FMT_H
8 #define _LUSTRE_QUOTA_FMT_H
10 #include <linux/types.h>
11 #include <linux/quota.h>
14 * Definitions of magics and versions of current quota files
15 * Same with quota v2's magic
17 #define LUSTRE_INITQMAGICS {\
18 0xd9c01f11, /* USRQUOTA */\
19 0xd9c01927 /* GRPQUOTA */\
22 #define LUSTRE_INITQVERSIONS {\
28 * The following structure defines the format of the disk quota file
29 * (as it appears on disk) - the file is a radix tree whose leaves point
30 * to blocks of these structures.
32 struct lustre_disk_dqblk {
33 __u32 dqb_id; /* id this quota applies to */
34 __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */
35 __u32 dqb_isoftlimit; /* preferred inode limit */
36 __u32 dqb_curinodes; /* current # allocated inodes */
37 __u32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */
38 __u32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */
39 __u64 dqb_curspace; /* current space occupied (in bytes) */
40 __u64 dqb_btime; /* time limit for excessive disk use */
41 __u64 dqb_itime; /* time limit for excessive inode use */
45 * Here are header structures as written on disk and their in-memory copies
47 /* First generic header */
48 struct lustre_disk_dqheader {
49 __u32 dqh_magic; /* Magic number identifying file */
50 __u32 dqh_version; /* File version */
53 /* Header with type and version specific information */
54 struct lustre_disk_dqinfo {
55 __u32 dqi_bgrace; /* Time before block soft limit becomes hard limit */
56 __u32 dqi_igrace; /* Time before inode soft limit becomes hard limit */
57 __u32 dqi_flags; /* Flags for quotafile (DQF_*) */
58 __u32 dqi_blocks; /* Number of blocks in file */
59 __u32 dqi_free_blk; /* Number of first free block in the list */
60 __u32 dqi_free_entry; /* Number of block with at least one free entry */
64 * Structure of header of block with quota structures. It is padded to 16 bytes so
65 * there will be space for exactly 21 quota-entries in a block
67 struct lustre_disk_dqdbheader {
68 __u32 dqdh_next_free; /* Number of next block with free entry */
69 __u32 dqdh_prev_free; /* Number of previous block with free entry */
70 __u16 dqdh_entries; /* Number of valid entries in block */
75 #define LUSTRE_DQINFOOFF sizeof(struct lustre_disk_dqheader) /* Offset of info header in file */
76 #define LUSTRE_DQBLKSIZE_BITS 10
77 #define LUSTRE_DQBLKSIZE (1 << LUSTRE_DQBLKSIZE_BITS) /* Size of block with quota structures */
78 #define LUSTRE_DQTREEOFF 1 /* Offset of tree in file in blocks */
79 #define LUSTRE_DQTREEDEPTH 4 /* Depth of quota tree */
80 #define LUSTRE_DQSTRINBLK ((LUSTRE_DQBLKSIZE - sizeof(struct lustre_disk_dqdbheader)) / sizeof(struct lustre_disk_dqblk)) /* Number of entries in one blocks */
83 #endif /* lustre_quota_fmt.h */