diff options
Diffstat (limited to 'fs/jfs/jfs_dmap.h')
-rw-r--r-- | fs/jfs/jfs_dmap.h | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/fs/jfs/jfs_dmap.h b/fs/jfs/jfs_dmap.h index 45ea454c74bd..11e6d471b364 100644 --- a/fs/jfs/jfs_dmap.h +++ b/fs/jfs/jfs_dmap.h | |||
@@ -83,7 +83,7 @@ static __inline signed char TREEMAX(signed char *cp) | |||
83 | * - 1 is added to account for the control page of the map. | 83 | * - 1 is added to account for the control page of the map. |
84 | */ | 84 | */ |
85 | #define BLKTODMAP(b,s) \ | 85 | #define BLKTODMAP(b,s) \ |
86 | ((((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1) << (s)) | 86 | ((((b) >> 13) + ((b) >> 23) + ((b) >> 33) + 3 + 1) << (s)) |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * convert disk block number to the logical block number of the LEVEL 0 | 89 | * convert disk block number to the logical block number of the LEVEL 0 |
@@ -98,7 +98,7 @@ static __inline signed char TREEMAX(signed char *cp) | |||
98 | * - 1 is added to account for the control page of the map. | 98 | * - 1 is added to account for the control page of the map. |
99 | */ | 99 | */ |
100 | #define BLKTOL0(b,s) \ | 100 | #define BLKTOL0(b,s) \ |
101 | (((((b) >> 23) << 10) + ((b) >> 23) + ((b) >> 33) + 2 + 1) << (s)) | 101 | (((((b) >> 23) << 10) + ((b) >> 23) + ((b) >> 33) + 2 + 1) << (s)) |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * convert disk block number to the logical block number of the LEVEL 1 | 104 | * convert disk block number to the logical block number of the LEVEL 1 |
@@ -120,7 +120,7 @@ static __inline signed char TREEMAX(signed char *cp) | |||
120 | * at the specified level which describes the disk block. | 120 | * at the specified level which describes the disk block. |
121 | */ | 121 | */ |
122 | #define BLKTOCTL(b,s,l) \ | 122 | #define BLKTOCTL(b,s,l) \ |
123 | (((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s))) | 123 | (((l) == 2) ? 1 : ((l) == 1) ? BLKTOL1((b),(s)) : BLKTOL0((b),(s))) |
124 | 124 | ||
125 | /* | 125 | /* |
126 | * convert aggregate map size to the zero origin dmapctl level of the | 126 | * convert aggregate map size to the zero origin dmapctl level of the |
@@ -145,27 +145,27 @@ static __inline signed char TREEMAX(signed char *cp) | |||
145 | * dmaptree must be consistent with dmapctl. | 145 | * dmaptree must be consistent with dmapctl. |
146 | */ | 146 | */ |
147 | struct dmaptree { | 147 | struct dmaptree { |
148 | __le32 nleafs; /* 4: number of tree leafs */ | 148 | __le32 nleafs; /* 4: number of tree leafs */ |
149 | __le32 l2nleafs; /* 4: l2 number of tree leafs */ | 149 | __le32 l2nleafs; /* 4: l2 number of tree leafs */ |
150 | __le32 leafidx; /* 4: index of first tree leaf */ | 150 | __le32 leafidx; /* 4: index of first tree leaf */ |
151 | __le32 height; /* 4: height of the tree */ | 151 | __le32 height; /* 4: height of the tree */ |
152 | s8 budmin; /* 1: min l2 tree leaf value to combine */ | 152 | s8 budmin; /* 1: min l2 tree leaf value to combine */ |
153 | s8 stree[TREESIZE]; /* TREESIZE: tree */ | 153 | s8 stree[TREESIZE]; /* TREESIZE: tree */ |
154 | u8 pad[2]; /* 2: pad to word boundary */ | 154 | u8 pad[2]; /* 2: pad to word boundary */ |
155 | }; /* - 360 - */ | 155 | }; /* - 360 - */ |
156 | 156 | ||
157 | /* | 157 | /* |
158 | * dmap page per 8K blocks bitmap | 158 | * dmap page per 8K blocks bitmap |
159 | */ | 159 | */ |
160 | struct dmap { | 160 | struct dmap { |
161 | __le32 nblocks; /* 4: num blks covered by this dmap */ | 161 | __le32 nblocks; /* 4: num blks covered by this dmap */ |
162 | __le32 nfree; /* 4: num of free blks in this dmap */ | 162 | __le32 nfree; /* 4: num of free blks in this dmap */ |
163 | __le64 start; /* 8: starting blkno for this dmap */ | 163 | __le64 start; /* 8: starting blkno for this dmap */ |
164 | struct dmaptree tree; /* 360: dmap tree */ | 164 | struct dmaptree tree; /* 360: dmap tree */ |
165 | u8 pad[1672]; /* 1672: pad to 2048 bytes */ | 165 | u8 pad[1672]; /* 1672: pad to 2048 bytes */ |
166 | __le32 wmap[LPERDMAP]; /* 1024: bits of the working map */ | 166 | __le32 wmap[LPERDMAP]; /* 1024: bits of the working map */ |
167 | __le32 pmap[LPERDMAP]; /* 1024: bits of the persistent map */ | 167 | __le32 pmap[LPERDMAP]; /* 1024: bits of the persistent map */ |
168 | }; /* - 4096 - */ | 168 | }; /* - 4096 - */ |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * disk map control page per level. | 171 | * disk map control page per level. |
@@ -173,14 +173,14 @@ struct dmap { | |||
173 | * dmapctl must be consistent with dmaptree. | 173 | * dmapctl must be consistent with dmaptree. |
174 | */ | 174 | */ |
175 | struct dmapctl { | 175 | struct dmapctl { |
176 | __le32 nleafs; /* 4: number of tree leafs */ | 176 | __le32 nleafs; /* 4: number of tree leafs */ |
177 | __le32 l2nleafs; /* 4: l2 number of tree leafs */ | 177 | __le32 l2nleafs; /* 4: l2 number of tree leafs */ |
178 | __le32 leafidx; /* 4: index of the first tree leaf */ | 178 | __le32 leafidx; /* 4: index of the first tree leaf */ |
179 | __le32 height; /* 4: height of tree */ | 179 | __le32 height; /* 4: height of tree */ |
180 | s8 budmin; /* 1: minimum l2 tree leaf value */ | 180 | s8 budmin; /* 1: minimum l2 tree leaf value */ |
181 | s8 stree[CTLTREESIZE]; /* CTLTREESIZE: dmapctl tree */ | 181 | s8 stree[CTLTREESIZE]; /* CTLTREESIZE: dmapctl tree */ |
182 | u8 pad[2714]; /* 2714: pad to 4096 */ | 182 | u8 pad[2714]; /* 2714: pad to 4096 */ |
183 | }; /* - 4096 - */ | 183 | }; /* - 4096 - */ |
184 | 184 | ||
185 | /* | 185 | /* |
186 | * common definition for dmaptree within dmap and dmapctl | 186 | * common definition for dmaptree within dmap and dmapctl |
@@ -202,41 +202,41 @@ typedef union dmtree { | |||
202 | * on-disk aggregate disk allocation map descriptor. | 202 | * on-disk aggregate disk allocation map descriptor. |
203 | */ | 203 | */ |
204 | struct dbmap_disk { | 204 | struct dbmap_disk { |
205 | __le64 dn_mapsize; /* 8: number of blocks in aggregate */ | 205 | __le64 dn_mapsize; /* 8: number of blocks in aggregate */ |
206 | __le64 dn_nfree; /* 8: num free blks in aggregate map */ | 206 | __le64 dn_nfree; /* 8: num free blks in aggregate map */ |
207 | __le32 dn_l2nbperpage; /* 4: number of blks per page */ | 207 | __le32 dn_l2nbperpage; /* 4: number of blks per page */ |
208 | __le32 dn_numag; /* 4: total number of ags */ | 208 | __le32 dn_numag; /* 4: total number of ags */ |
209 | __le32 dn_maxlevel; /* 4: number of active ags */ | 209 | __le32 dn_maxlevel; /* 4: number of active ags */ |
210 | __le32 dn_maxag; /* 4: max active alloc group number */ | 210 | __le32 dn_maxag; /* 4: max active alloc group number */ |
211 | __le32 dn_agpref; /* 4: preferred alloc group (hint) */ | 211 | __le32 dn_agpref; /* 4: preferred alloc group (hint) */ |
212 | __le32 dn_aglevel; /* 4: dmapctl level holding the AG */ | 212 | __le32 dn_aglevel; /* 4: dmapctl level holding the AG */ |
213 | __le32 dn_agheigth; /* 4: height in dmapctl of the AG */ | 213 | __le32 dn_agheigth; /* 4: height in dmapctl of the AG */ |
214 | __le32 dn_agwidth; /* 4: width in dmapctl of the AG */ | 214 | __le32 dn_agwidth; /* 4: width in dmapctl of the AG */ |
215 | __le32 dn_agstart; /* 4: start tree index at AG height */ | 215 | __le32 dn_agstart; /* 4: start tree index at AG height */ |
216 | __le32 dn_agl2size; /* 4: l2 num of blks per alloc group */ | 216 | __le32 dn_agl2size; /* 4: l2 num of blks per alloc group */ |
217 | __le64 dn_agfree[MAXAG];/* 8*MAXAG: per AG free count */ | 217 | __le64 dn_agfree[MAXAG];/* 8*MAXAG: per AG free count */ |
218 | __le64 dn_agsize; /* 8: num of blks per alloc group */ | 218 | __le64 dn_agsize; /* 8: num of blks per alloc group */ |
219 | s8 dn_maxfreebud; /* 1: max free buddy system */ | 219 | s8 dn_maxfreebud; /* 1: max free buddy system */ |
220 | u8 pad[3007]; /* 3007: pad to 4096 */ | 220 | u8 pad[3007]; /* 3007: pad to 4096 */ |
221 | }; /* - 4096 - */ | 221 | }; /* - 4096 - */ |
222 | 222 | ||
223 | struct dbmap { | 223 | struct dbmap { |
224 | s64 dn_mapsize; /* number of blocks in aggregate */ | 224 | s64 dn_mapsize; /* number of blocks in aggregate */ |
225 | s64 dn_nfree; /* num free blks in aggregate map */ | 225 | s64 dn_nfree; /* num free blks in aggregate map */ |
226 | int dn_l2nbperpage; /* number of blks per page */ | 226 | int dn_l2nbperpage; /* number of blks per page */ |
227 | int dn_numag; /* total number of ags */ | 227 | int dn_numag; /* total number of ags */ |
228 | int dn_maxlevel; /* number of active ags */ | 228 | int dn_maxlevel; /* number of active ags */ |
229 | int dn_maxag; /* max active alloc group number */ | 229 | int dn_maxag; /* max active alloc group number */ |
230 | int dn_agpref; /* preferred alloc group (hint) */ | 230 | int dn_agpref; /* preferred alloc group (hint) */ |
231 | int dn_aglevel; /* dmapctl level holding the AG */ | 231 | int dn_aglevel; /* dmapctl level holding the AG */ |
232 | int dn_agheigth; /* height in dmapctl of the AG */ | 232 | int dn_agheigth; /* height in dmapctl of the AG */ |
233 | int dn_agwidth; /* width in dmapctl of the AG */ | 233 | int dn_agwidth; /* width in dmapctl of the AG */ |
234 | int dn_agstart; /* start tree index at AG height */ | 234 | int dn_agstart; /* start tree index at AG height */ |
235 | int dn_agl2size; /* l2 num of blks per alloc group */ | 235 | int dn_agl2size; /* l2 num of blks per alloc group */ |
236 | s64 dn_agfree[MAXAG]; /* per AG free count */ | 236 | s64 dn_agfree[MAXAG]; /* per AG free count */ |
237 | s64 dn_agsize; /* num of blks per alloc group */ | 237 | s64 dn_agsize; /* num of blks per alloc group */ |
238 | signed char dn_maxfreebud; /* max free buddy system */ | 238 | signed char dn_maxfreebud; /* max free buddy system */ |
239 | }; /* - 4096 - */ | 239 | }; /* - 4096 - */ |
240 | /* | 240 | /* |
241 | * in-memory aggregate disk allocation map descriptor. | 241 | * in-memory aggregate disk allocation map descriptor. |
242 | */ | 242 | */ |