Lines Matching +full:max +full:- +full:by +full:- +full:define

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) International Business Machines Corp., 2000-2002
6 #define _H_JFS_DMAP
10 #define BMAPVERSION 1 /* version number */
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 */
15 #define DBWORD 32 /* # of blks covered by a map word */
16 #define L2DBWORD 5 /* l2 # of blks covered by a mword */
17 #define BUDMIN L2DBWORD /* max free string in a map word */
18 #define BPERDMAP (LPERDMAP * DBWORD) /* num of blks per dmap */
19 #define L2BPERDMAP 13 /* l2 num of blks per dmap */
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 */
26 #define MAXAG 128 /* max number of allocation groups */
27 #define L2MAXAG 7 /* l2 max num of AG */
28 #define L2MINAGSZ 25 /* l2 of minimum AG size in bytes */
29 #define BMAPBLKNO 0 /* lblkno of bmap within the map */
34 #define L2MAXL0SIZE (L2BPERDMAP + 1 * L2LPERCTL)
35 #define L2MAXL1SIZE (L2BPERDMAP + 2 * L2LPERCTL)
36 #define L2MAXL2SIZE (L2BPERDMAP + 3 * L2LPERCTL)
41 #define MAXL0SIZE ((s64)1 << L2MAXL0SIZE)
42 #define MAXL1SIZE ((s64)1 << L2MAXL1SIZE)
43 #define MAXL2SIZE ((s64)1 << L2MAXL2SIZE)
45 #define MAXMAPSIZE MAXL2SIZE /* maximum aggregate map size */
55 tmp1 = max(*(cp+2), *(cp+3)); in TREEMAX()
56 tmp2 = max(*(cp), *(cp+1)); in TREEMAX()
58 return max(tmp1, tmp2); in TREEMAX()
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.
72 #define BLKTODMAP(b,s) \
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.
87 #define BLKTOL0(b,s) \
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.
102 #define BLKTOL1(b,s) \
109 #define BLKTOCTL(b,s,l) \
116 #define BMAPSZTOLEV(size) \
121 #define BLKTOAG(b,sbi) ((b) >> ((sbi)->bmap->db_agl2size))
126 #define AGTOBLK(a,ip) \
127 ((s64)(a) << (JFS_SBI((ip)->i_sb)->bmap->db_agl2size))
142 }; /* - 360 - */
148 __le32 nblocks; /* 4: num blks covered by this dmap */
155 }; /* - 4096 - */
170 }; /* - 4096 - */
181 #define dmt_nleafs t1.nleafs
182 #define dmt_l2nleafs t1.l2nleafs
183 #define dmt_leafidx t1.leafidx
184 #define dmt_height t1.height
185 #define dmt_budmin t1.budmin
186 #define dmt_stree t2.stree
189 * on-disk aggregate disk allocation map descriptor.
197 __le32 dn_maxag; /* 4: max active alloc group number */
206 s8 dn_maxfreebud; /* 1: max free buddy system */
208 }; /* - 4096 - */
216 int dn_maxag; /* max active alloc group number */
225 signed char dn_maxfreebud; /* max free buddy system */
226 }; /* - 4096 - */
228 * in-memory aggregate disk allocation map descriptor.
231 struct dbmap db_bmap; /* on-disk aggregate map descriptor */
238 /* macros for accessing fields within in-memory aggregate map descriptor */
239 #define db_mapsize db_bmap.dn_mapsize
240 #define db_nfree db_bmap.dn_nfree
241 #define db_agfree db_bmap.dn_agfree
242 #define db_agsize db_bmap.dn_agsize
243 #define db_agl2size db_bmap.dn_agl2size
244 #define db_agwidth db_bmap.dn_agwidth
245 #define db_agheight db_bmap.dn_agheight
246 #define db_agstart db_bmap.dn_agstart
247 #define db_numag db_bmap.dn_numag
248 #define db_maxlevel db_bmap.dn_maxlevel
249 #define db_aglevel db_bmap.dn_aglevel
250 #define db_agpref db_bmap.dn_agpref
251 #define db_maxag db_bmap.dn_maxag
252 #define db_maxfreebud db_bmap.dn_maxfreebud
253 #define db_l2nbperpage db_bmap.dn_l2nbperpage
256 * macros for various conversions needed by the allocators.
262 #define BLKSTOL2(d) (blkstol2(d))
265 #define NLSTOL2BSZ(n) (31 - cntlz((n)) + BUDMIN)
268 #define LITOL2BSZ(n,m,b) ((((n) == 0) ? (m) : cnttz((n))) + (b))
271 #define BLKTOCTLLEAF(b,m) \
272 (((b) & (((s64)1 << ((m) + L2LPERCTL)) - 1)) >> (m))
275 #define BUDSIZE(s,m) (1 << ((s) - (m)))