• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  *	Header file for disk format of new quotafile format
4  *
5  */
6 
7 #ifndef GUARD_QUOTAIO_V2_H
8 #define GUARD_QUOTAIO_V2_H
9 
10 #include <sys/types.h>
11 #include "quotaio.h"
12 
13 /* Offset of info header in file */
14 #define V2_DQINFOOFF		sizeof(struct v2_disk_dqheader)
15 /* Supported version of quota-tree format */
16 #define V2_VERSION 1
17 
18 struct v2_disk_dqheader {
19 	__le32 dqh_magic;	/* Magic number identifying file */
20 	__le32 dqh_version;	/* File version */
21 };
22 
23 static_assert(sizeof(struct v2_disk_dqheader) == 8, "");
24 
25 /* Flags for version specific files */
26 #define V2_DQF_MASK  0x0000	/* Mask for all valid ondisk flags */
27 
28 /* Header with type and version specific information */
29 struct v2_disk_dqinfo {
30 	__le32 dqi_bgrace;	/* Time before block soft limit becomes
31 				 * hard limit */
32 	__le32 dqi_igrace;	/* Time before inode soft limit becomes
33 				 * hard limit */
34 	__le32 dqi_flags;	/* Flags for quotafile (DQF_*) */
35 	__le32 dqi_blocks;	/* Number of blocks in file */
36 	__le32 dqi_free_blk;	/* Number of first free block in the list */
37 	__le32 dqi_free_entry;	/* Number of block with at least one
38 					 * free entry */
39 };
40 
41 static_assert(sizeof(struct v2_disk_dqinfo) == 24, "");
42 
43 struct v2r1_disk_dqblk {
44 	__le32 dqb_id;	/* id this quota applies to */
45 	__le32 dqb_pad;
46 	__le64 dqb_ihardlimit;	/* absolute limit on allocated inodes */
47 	__le64 dqb_isoftlimit;	/* preferred inode limit */
48 	__le64 dqb_curinodes;	/* current # allocated inodes */
49 	__le64 dqb_bhardlimit;	/* absolute limit on disk space
50 					 * (in QUOTABLOCK_SIZE) */
51 	__le64 dqb_bsoftlimit;	/* preferred limit on disk space
52 					 * (in QUOTABLOCK_SIZE) */
53 	__le64 dqb_curspace;	/* current space occupied (in bytes) */
54 	__le64 dqb_btime;	/* time limit for excessive disk use */
55 	__le64 dqb_itime;	/* time limit for excessive inode use */
56 };
57 
58 static_assert(sizeof(struct v2r1_disk_dqblk) == 72, "");
59 
60 #endif
61