^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Definitions of structures for vfsv0 quota format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef _LINUX_QUOTAIO_V2_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define _LINUX_QUOTAIO_V2_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/quota.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * Definitions of magics and versions of current quota files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define V2_INITQMAGICS {\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 0xd9c01f11, /* USRQUOTA */\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 0xd9c01927, /* GRPQUOTA */\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 0xd9c03f14, /* PRJQUOTA */\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define V2_INITQVERSIONS {\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 1, /* USRQUOTA */\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 1, /* GRPQUOTA */\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 1, /* PRJQUOTA */\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) /* First generic header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) struct v2_disk_dqheader {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __le32 dqh_magic; /* Magic number identifying file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __le32 dqh_version; /* File version */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * The following structure defines the format of the disk quota file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * (as it appears on disk) - the file is a radix tree whose leaves point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * to blocks of these structures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct v2r0_disk_dqblk {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) __le32 dqb_id; /* id this quota applies to */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) __le32 dqb_isoftlimit; /* preferred inode limit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) __le32 dqb_curinodes; /* current # allocated inodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) __le64 dqb_curspace; /* current space occupied (in bytes) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) __le64 dqb_btime; /* time limit for excessive disk use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) __le64 dqb_itime; /* time limit for excessive inode use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct v2r1_disk_dqblk {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) __le32 dqb_id; /* id this quota applies to */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) __le32 dqb_pad;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) __le64 dqb_ihardlimit; /* absolute limit on allocated inodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) __le64 dqb_isoftlimit; /* preferred inode limit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) __le64 dqb_curinodes; /* current # allocated inodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) __le64 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) __le64 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __le64 dqb_curspace; /* current space occupied (in bytes) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) __le64 dqb_btime; /* time limit for excessive disk use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __le64 dqb_itime; /* time limit for excessive inode use */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) /* Header with type and version specific information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) struct v2_disk_dqinfo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) __le32 dqi_flags; /* Flags for quotafile (DQF_*) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) __le32 dqi_blocks; /* Number of blocks in file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) __le32 dqi_free_blk; /* Number of first free block in the list */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __le32 dqi_free_entry; /* Number of block with at least one free entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define V2_DQBLKSIZE_BITS 10 /* Size of leaf block in tree */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif /* _LINUX_QUOTAIO_V2_H */