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 u_int32_t dqh_magic; /* Magic number identifying file */ 20 u_int32_t dqh_version; /* File version */ 21 } __attribute__ ((packed)); 22 23 /* Flags for version specific files */ 24 #define V2_DQF_MASK 0x0000 /* Mask for all valid ondisk flags */ 25 26 /* Header with type and version specific information */ 27 struct v2_disk_dqinfo { 28 u_int32_t dqi_bgrace; /* Time before block soft limit becomes 29 * hard limit */ 30 u_int32_t dqi_igrace; /* Time before inode soft limit becomes 31 * hard limit */ 32 u_int32_t dqi_flags; /* Flags for quotafile (DQF_*) */ 33 u_int32_t dqi_blocks; /* Number of blocks in file */ 34 u_int32_t dqi_free_blk; /* Number of first free block in the list */ 35 u_int32_t dqi_free_entry; /* Number of block with at least one 36 * free entry */ 37 } __attribute__ ((packed)); 38 39 struct v2r1_disk_dqblk { 40 u_int32_t dqb_id; /* id this quota applies to */ 41 u_int32_t dqb_pad; 42 u_int64_t dqb_ihardlimit; /* absolute limit on allocated inodes */ 43 u_int64_t dqb_isoftlimit; /* preferred inode limit */ 44 u_int64_t dqb_curinodes; /* current # allocated inodes */ 45 u_int64_t dqb_bhardlimit; /* absolute limit on disk space 46 * (in QUOTABLOCK_SIZE) */ 47 u_int64_t dqb_bsoftlimit; /* preferred limit on disk space 48 * (in QUOTABLOCK_SIZE) */ 49 u_int64_t dqb_curspace; /* current space occupied (in bytes) */ 50 u_int64_t dqb_btime; /* time limit for excessive disk use */ 51 u_int64_t dqb_itime; /* time limit for excessive inode use */ 52 } __attribute__ ((packed)); 53 54 #endif 55