diff options
author | Jan Kara <jack@suse.cz> | 2008-09-21 23:54:49 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:40:21 -0500 |
commit | 1ccd14b9c271c1ac6eec5c5ec5def433100e7248 (patch) | |
tree | 959756aa5b68c568a18697464df3f0acdd0387cf /fs/quotaio_v2.h | |
parent | cf770c137122b78470a67ebd5498947869a09197 (diff) |
quota: Split off quota tree handling into a separate file
There is going to be a new version of quota format having 64-bit
quota limits and a new quota format for OCFS2. They are both
going to use the same tree structure as VFSv0 quota format. So
split out tree handling into a separate file and make size of
leaf blocks, amount of space usable in each block (needed for
checksumming) and structures contained in them configurable
so that the code can be shared.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/quotaio_v2.h')
-rw-r--r-- | fs/quotaio_v2.h | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/fs/quotaio_v2.h b/fs/quotaio_v2.h index 303d7cbe30d4..530fe580685c 100644 --- a/fs/quotaio_v2.h +++ b/fs/quotaio_v2.h | |||
@@ -21,6 +21,12 @@ | |||
21 | 0 /* GRPQUOTA */\ | 21 | 0 /* GRPQUOTA */\ |
22 | } | 22 | } |
23 | 23 | ||
24 | /* First generic header */ | ||
25 | struct v2_disk_dqheader { | ||
26 | __le32 dqh_magic; /* Magic number identifying file */ | ||
27 | __le32 dqh_version; /* File version */ | ||
28 | }; | ||
29 | |||
24 | /* | 30 | /* |
25 | * The following structure defines the format of the disk quota file | 31 | * The following structure defines the format of the disk quota file |
26 | * (as it appears on disk) - the file is a radix tree whose leaves point | 32 | * (as it appears on disk) - the file is a radix tree whose leaves point |
@@ -38,15 +44,6 @@ struct v2_disk_dqblk { | |||
38 | __le64 dqb_itime; /* time limit for excessive inode use */ | 44 | __le64 dqb_itime; /* time limit for excessive inode use */ |
39 | }; | 45 | }; |
40 | 46 | ||
41 | /* | ||
42 | * Here are header structures as written on disk and their in-memory copies | ||
43 | */ | ||
44 | /* First generic header */ | ||
45 | struct v2_disk_dqheader { | ||
46 | __le32 dqh_magic; /* Magic number identifying file */ | ||
47 | __le32 dqh_version; /* File version */ | ||
48 | }; | ||
49 | |||
50 | /* Header with type and version specific information */ | 47 | /* Header with type and version specific information */ |
51 | struct v2_disk_dqinfo { | 48 | struct v2_disk_dqinfo { |
52 | __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ | 49 | __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ |
@@ -57,23 +54,7 @@ struct v2_disk_dqinfo { | |||
57 | __le32 dqi_free_entry; /* Number of block with at least one free entry */ | 54 | __le32 dqi_free_entry; /* Number of block with at least one free entry */ |
58 | }; | 55 | }; |
59 | 56 | ||
60 | /* | ||
61 | * Structure of header of block with quota structures. It is padded to 16 bytes so | ||
62 | * there will be space for exactly 21 quota-entries in a block | ||
63 | */ | ||
64 | struct v2_disk_dqdbheader { | ||
65 | __le32 dqdh_next_free; /* Number of next block with free entry */ | ||
66 | __le32 dqdh_prev_free; /* Number of previous block with free entry */ | ||
67 | __le16 dqdh_entries; /* Number of valid entries in block */ | ||
68 | __le16 dqdh_pad1; | ||
69 | __le32 dqdh_pad2; | ||
70 | }; | ||
71 | |||
72 | #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ | 57 | #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ |
73 | #define V2_DQBLKSIZE_BITS 10 | 58 | #define V2_DQBLKSIZE_BITS 10 /* Size of leaf block in tree */ |
74 | #define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ | ||
75 | #define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ | ||
76 | #define V2_DQTREEDEPTH 4 /* Depth of quota tree */ | ||
77 | #define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ | ||
78 | 59 | ||
79 | #endif /* _LINUX_QUOTAIO_V2_H */ | 60 | #endif /* _LINUX_QUOTAIO_V2_H */ |