diff options
Diffstat (limited to 'quotaio_v2.h')
-rw-r--r-- | quotaio_v2.h | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/quotaio_v2.h b/quotaio_v2.h index 2482156..092f22f 100644 --- a/quotaio_v2.h +++ b/quotaio_v2.h @@ -11,14 +11,7 @@ #include "quota.h" #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ -#define V2_DQBLKSIZE_BITS 10 -#define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ -#define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ -#define V2_DQTREEDEPTH 4 /* Depth of quota tree */ -#define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ -#define V2_GETIDINDEX(id, depth) (((id) >> ((V2_DQTREEDEPTH-(depth)-1)*8)) & 0xff) -#define V2_GETENTRIES(buf) ((struct v2_disk_dqblk *)(((char *)(buf)) + sizeof(struct v2_disk_dqdbheader))) -#define INIT_V2_VERSIONS { 0, 0} +#define INIT_V2_VERSIONS { 1, 1} struct v2_disk_dqheader { u_int32_t dqh_magic; /* Magic number identifying file */ @@ -38,20 +31,8 @@ struct v2_disk_dqinfo { u_int32_t dqi_free_entry; /* Number of block with at least one free entry */ } __attribute__ ((packed)); -/* - * Structure of header of block with quota structures. It is padded to 16 bytes so - * there will be space for exactly 18 quota-entries in a block - */ -struct v2_disk_dqdbheader { - u_int32_t dqdh_next_free; /* Number of next block with free entry */ - u_int32_t dqdh_prev_free; /* Number of previous block with free entry */ - u_int16_t dqdh_entries; /* Number of valid entries in block */ - u_int16_t dqdh_pad1; - u_int32_t dqdh_pad2; -} __attribute__ ((packed)); - /* Structure of quota for one user on disk */ -struct v2_disk_dqblk { +struct v2r0_disk_dqblk { u_int32_t dqb_id; /* id this quota applies to */ u_int32_t dqb_ihardlimit; /* absolute limit on allocated inodes */ u_int32_t dqb_isoftlimit; /* preferred inode limit */ @@ -63,6 +44,19 @@ struct v2_disk_dqblk { u_int64_t dqb_itime; /* time limit for excessive inode use */ } __attribute__ ((packed)); +struct v2r1_disk_dqblk { + u_int32_t dqb_id; /* id this quota applies to */ + u_int32_t dqb_pad; + u_int64_t dqb_ihardlimit; /* absolute limit on allocated inodes */ + u_int64_t dqb_isoftlimit; /* preferred inode limit */ + u_int64_t dqb_curinodes; /* current # allocated inodes */ + u_int64_t dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ + u_int64_t dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ + u_int64_t dqb_curspace; /* current space occupied (in bytes) */ + u_int64_t dqb_btime; /* time limit for excessive disk use */ + u_int64_t dqb_itime; /* time limit for excessive inode use */ +} __attribute__ ((packed)); + /* Structure of quota for communication with kernel */ struct v2_kern_dqblk { unsigned int dqb_ihardlimit; @@ -75,7 +69,7 @@ struct v2_kern_dqblk { time_t dqb_itime; }; -/* Structure of quotafile info for communication with kernel */ +/* Structure of quotafile info for communication with kernel (obsolete) */ struct v2_kern_dqinfo { unsigned int dqi_bgrace; unsigned int dqi_igrace; |