Lines Matching +full:in +full:- +full:tree
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) International Business Machines Corp., 2000-2002
11 #define TREESIZE (256+64+16+4+1) /* size of a dmap tree */
12 #define LEAFIND (64+16+4+1) /* index of 1st leaf of a dmap tree */
13 #define LPERDMAP 256 /* num leaves per dmap tree */
14 #define L2LPERDMAP 8 /* l2 number of leaves per dmap tree */
17 #define BUDMIN L2DBWORD /* max free string in a map word */
20 #define CTLTREESIZE (1024+256+64+16+4+1) /* size of a dmapctl tree */
21 #define CTLLEAFIND (256+64+16+4+1) /* idx of 1st leaf of a dmapctl tree */
22 #define LPERCTL 1024 /* num of leaves per dmapctl tree */
23 #define L2LPERCTL 10 /* l2 num of leaves per dmapctl tree */
24 #define ROOT 0 /* index of the root of a tree */
25 #define NOFREE ((s8) -1) /* no blocks free */
28 #define L2MINAGSZ 25 /* l2 of minimum AG size in bytes */
49 * of the tree.
65 * The calculation figures out how many logical pages are in front of the dmap.
66 * - the number of dmaps preceding it
67 * - the number of L0 pages preceding its L0 page
68 * - the number of L1 pages preceding its L1 page
69 * - 3 is added to account for the L2, L1, and L0 page for this dmap
70 * - 1 is added to account for the control page of the map.
80 * The calculation figures out how many logical pages are in front of the L0.
81 * - the number of dmap pages preceding it
82 * - the number of L0 pages preceding it
83 * - the number of L1 pages preceding its L1 page
84 * - 2 is added to account for the L2, and L1 page for this L0
85 * - 1 is added to account for the control page of the map.
95 * The calculation figures out how many logical pages are in front of the L1.
96 * - the number of dmap pages preceding it
97 * - the number of L0 pages preceding it
98 * - the number of L1 pages preceding it
99 * - 1 is added to account for the L2 page
100 * - 1 is added to account for the control page of the map.
121 #define BLKTOAG(b,sbi) ((b) >> ((sbi)->bmap->db_agl2size))
127 ((s64)(a) << (JFS_SBI((ip)->i_sb)->bmap->db_agl2size))
130 * dmap summary tree
135 __le32 nleafs; /* 4: number of tree leafs */
136 __le32 l2nleafs; /* 4: l2 number of tree leafs */
137 __le32 leafidx; /* 4: index of first tree leaf */
138 __le32 height; /* 4: height of the tree */
139 s8 budmin; /* 1: min l2 tree leaf value to combine */
140 s8 stree[TREESIZE]; /* TREESIZE: tree */
142 }; /* - 360 - */
149 __le32 nfree; /* 4: num of free blks in this dmap */
151 struct dmaptree tree; /* 360: dmap tree */ member
155 }; /* - 4096 - */
163 __le32 nleafs; /* 4: number of tree leafs */
164 __le32 l2nleafs; /* 4: l2 number of tree leafs */
165 __le32 leafidx; /* 4: index of the first tree leaf */
166 __le32 height; /* 4: height of tree */
167 s8 budmin; /* 1: minimum l2 tree leaf value */
168 s8 stree[CTLTREESIZE]; /* CTLTREESIZE: dmapctl tree */
170 }; /* - 4096 - */
189 * on-disk aggregate disk allocation map descriptor.
192 __le64 dn_mapsize; /* 8: number of blocks in aggregate */
193 __le64 dn_nfree; /* 8: num free blks in aggregate map */
200 __le32 dn_agheight; /* 4: height in dmapctl of the AG */
201 __le32 dn_agwidth; /* 4: width in dmapctl of the AG */
202 __le32 dn_agstart; /* 4: start tree index at AG height */
208 }; /* - 4096 - */
211 s64 dn_mapsize; /* number of blocks in aggregate */
212 s64 dn_nfree; /* num free blks in aggregate map */
219 int dn_agheight; /* height in dmapctl of the AG */
220 int dn_agwidth; /* width in dmapctl of the AG */
221 int dn_agstart; /* start tree index at AG height */
226 }; /* - 4096 - */
228 * in-memory aggregate disk allocation map descriptor.
231 struct dbmap db_bmap; /* on-disk aggregate map descriptor */
234 atomic_t db_active[MAXAG]; /* count of active, open files in AG */
238 /* macros for accessing fields within in-memory aggregate map descriptor */
265 #define NLSTOL2BSZ(n) (31 - cntlz((n)) + BUDMIN)
272 (((b) & (((s64)1 << ((m) + L2LPERCTL)) - 1)) >> (m))
275 #define BUDSIZE(s,m) (1 << ((s) - (m)))