Lines Matching refs:dmap
24 * 1) allocation and free requests that start at the dmap
25 * level and move up through the dmap control pages (i.e.
28 * 2) allocation requests that start at dmap control page
35 * as it works it way up from a single dmap to the required level
36 * of dmap control page.
45 * in addition to information found in dmaps and dmap control pages,
64 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
73 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
75 static int dbAllocNear(struct bmap * bmp, struct dmap * dp, s64 blkno,
78 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
80 static int dbAllocDmapLev(struct bmap * bmp, struct dmap * dp, int nblocks,
91 static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
93 static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
101 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
103 static int dbInitDmap(struct dmap * dp, s64 blkno, int nblocks);
104 static int dbInitDmapTree(struct dmap * dp);
113 * dmap bitmap words. the characters themselves serve as indexes
343 * the blocks will be free from the working map one dmap
358 struct dmap *dp;
385 * free the blocks a dmap at a time.
389 /* release previous dmap if any */
394 /* get the buffer for the current dmap. */
401 dp = (struct dmap *) mp->data;
404 * this dmap.
434 * dmap at a time.
457 struct dmap *dp;
478 * update the block state a dmap at a time.
483 /* get the buffer for the current dmap. */
496 dp = (struct dmap *) mp->data;
498 /* determine the bit number and word within the dmap of
500 * are to be updated within this dmap.
506 /* update the bits of the dmap words. the first and last
559 * update dmap lsn
697 * per dmap, we first try to allocate the new blocks
701 * allocate within the same dmap as contains the hint.
703 * if no blocks are available in the dmap or the allocation
704 * request is larger than the dmap size, we try to allocate
732 struct dmap *dp;
797 * single dmap. if so, try to allocate from the dmap containing
803 /* get the buffer for the dmap containing the hint.
811 dp = (struct dmap *) mp->data;
853 * the same dmap as the hint.
923 struct dmap *dp;
934 * allocation request size must be satisfied from a single dmap.
947 /* read in the dmap covering the extent */
954 dp = (struct dmap *) mp->data;
1057 struct dmap *dp;
1091 * can fit into a dmap, the last block of the current allocation
1101 /* get the buffer for the dmap containing the first block
1111 dp = (struct dmap *) mp->data;
1135 * range within a dmap.
1139 * dp - pointer to dmap.
1150 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
1159 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n");
1163 /* pick up a pointer to the leaves of the dmap tree.
1167 /* determine the bit number and word within the dmap of the
1174 * this dmap.
1191 * will be used for all dmap words fully contained within the
1192 * specified range. within this pass, the leaves of the dmap
1194 * single leaf may describe the free space of multiple dmap
1196 * corresponding to the dmap words of the block range.
1216 /* one or more dmap words are fully contained
1258 * a specified block (hint) within a dmap.
1260 * starting with the dmap leaf that covers the hint, we'll
1267 * dp - pointer to dmap.
1283 struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results)
1289 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n");
1295 /* determine the word within the dmap that holds the hint
1296 * (i.e. blkno). also, determine the last word in the dmap
1311 * of the first block described by this dmap word.
1315 /* if not all bits of the dmap word are free, get the
1316 * starting bit number within the dmap word of the required
1343 * of blocks per dmap, the dmap control pages will be used to
1345 * search at the highest dmap control page level which
1358 * move the search to the next lower level dmap control page
1359 * corresponding to this leaf. we continue down the dmap control
1360 * pages until we find the dmap that contains or starts the
1361 * sufficient free space and we allocate at this dmap.
1363 * if the allocation group size is equal to the dmap size,
1364 * we'll start at the dmap corresponding to the allocation
1367 * the dmap control page search is also not performed if the
1369 * dmap of the allocation group to do the allocation. this is
1371 * part) of a larger binary buddy system, causing the dmap
1416 * 1 dmap), there is no need to search the dmap control page (below)
1418 * group is already fully described by a dmap. in this case, we
1419 * just call dbAllocCtl() to search the dmap tree and allocate the
1424 * two reasons. first, it makes no sense searching the dmap control
1426 * the dmap control pages may indicate that the allocation group
1444 /* the buffer for the dmap control page that fully describes the
1460 /* search the subtree(s) of the dmap control page that describes
1462 * determine how many allocation groups are represented in a dmap
1471 /* dmap control page trees fan-out by 4 and a single allocation
1473 * dmap control page, depending upon the ag size. examine the ag's
1516 * the next level of dmap control pages.
1521 * level dmap control pages. we need to if the number of
1527 /* search the lower level dmap control pages to get
1528 * the starting block number of the dmap that
1570 * searching down the dmap control pages, starting with the
1594 /* starting with the top level dmap control page, search
1595 * down the dmap control levels for sufficient free space.
1597 * block number of the dmap that contains or starts off the
1632 * - we write two times to the dmapctl and dmap pages
1727 * FUNCTION: starting at a specified dmap control page level and block
1728 * number, search down the dmap control levels for a range of
1733 * returns the starting block number within a dmap page that
1739 * level - starting dmap control page level.
1742 * on successful return, the first block within a dmap page
1760 /* starting at the specified dmap control page level and block
1761 * number, search down the dmap control levels for the starting
1762 * block number of a dmap page that contains or starts off
1766 /* get the buffer of the dmap control page for the block
1783 /* search the tree within the dmap control page for
1799 "dmap inconsistent\n");
1806 * the dmap control page (i.e. the leaf) at which free
1811 /* we stop the search at this dmap control page level if
1829 * blocks starting within a specific dmap.
1832 * the dmap control pages above the actual dmaps for contiguous
1843 * group whose size is equal to the number of blocks per dmap.
1844 * in this case, the dmap control pages are not examined prior
1848 * for a request size that fits within a dmap, this routine relies
1849 * upon the dmap's dmtree to find the requested contiguous free
1850 * space. for request sizes that are larger than a dmap, the
1852 * first dmap (i.e. blkno).
1858 * blkno - starting block number of the dmap to start the allocation
1876 struct dmap *dp;
1878 /* check if the allocation request is confined to a single dmap.
1881 /* get the buffer for the dmap.
1887 dp = (struct dmap *) mp->data;
1901 * a dmap boundary.
1905 /* allocate the blocks dmap by dmap.
1908 /* get the buffer for the dmap.
1916 dp = (struct dmap *) mp->data;
1918 /* the dmap better be all free.
1923 "the dmap is not all free\n");
1928 /* determine how many blocks to allocate from this dmap.
1932 /* allocate the blocks from the dmap.
1957 /* try to backout the allocations dmap by dmap.
1961 /* get the buffer for this dmap.
1973 dp = (struct dmap *) mp->data;
1975 /* free the blocks is this dmap.
1999 * from a specified dmap.
2007 * dp - pointer to dmap to attempt to allocate blocks from.
2023 struct dmap * dp, int nblocks, int l2nb, s64 * results)
2031 /* search the tree within the dmap page for sufficient
2046 /* if not all bits of the dmap word are free, get the starting
2047 * bit number within the dmap word of the required string of free
2065 * of a specified block range within a dmap.
2067 * this routine allocates the specified blocks from the dmap
2070 * the dmap to change (i.e. the value of the root of the dmap's
2072 * up through the appropriate levels of the dmap control pages
2073 * by a call to dbAdjCtl() for the L0 dmap control page that
2074 * covers this dmap.
2078 * dp - pointer to dmap to allocate the block range from.
2088 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
2095 * of the dmap tree.
2106 /* root changed. bubble the change up to the dmap control pages.
2121 * of a specified block range within a dmap.
2123 * this routine frees the specified blocks from the dmap through
2125 * causes the maximum string of free blocks within the dmap to
2126 * change (i.e. the value of the root of the dmap's dmtree), this
2128 * appropriate levels of the dmap control pages by a call to
2129 * dbAdjCtl() for the L0 dmap control page that covers this dmap.
2133 * dp - pointer to dmap to free the block range from.
2143 static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
2150 * of the dmap tree.
2161 /* root changed. bubble the change up to the dmap control pages.
2169 * to back split the dmap tree if the deallocation caused
2186 * FUNCTION: allocate a specified block range from a dmap.
2188 * this routine updates the dmap to reflect the working
2191 * of the binary buddy system described by the dmap's dmtree
2193 * dmap's dmtree, as a whole, to reflect the allocated range.
2197 * dp - pointer to dmap to allocate bits from.
2205 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
2213 /* pick up a pointer to the leaves of the dmap tree */
2216 /* determine the bit number and word within the dmap of the
2222 /* block range better be within the dmap */
2225 /* allocate the bits of the dmap's words corresponding to the block
2230 * updating the leaf corresponding to the dmap word. a single pass
2231 * will be used for all dmap words fully contained within the
2233 * dmap words will be marked as free in a single shot and the leaves
2235 * multiple dmap words, so we may update only a subset of the actual
2236 * leaves corresponding to the dmap words of the block range.
2249 * this dmap word.
2254 /* update the leaf for this dmap word. in addition
2256 * of the updated dmap word, dbSplit() will split
2264 /* one or more dmap words are fully contained
2302 /* get the number of dmap words handled */
2309 /* update the free count for this dmap */
2333 * FUNCTION: free a specified block range from a dmap.
2335 * this routine updates the dmap to reflect the working
2338 * of the binary buddy system described by the dmap's dmtree
2339 * leaves to reflect the bits freed. it also causes the dmap's
2344 * dp - pointer to dmap to free bits from.
2352 static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
2360 /* determine the bit number and word within the dmap of the
2366 /* block range better be within the dmap.
2375 * the leaf corresponding to the dmap word. a single pass will be used
2376 * for all dmap words fully contained within the specified range.
2377 * within this pass, the bits of all fully contained dmap words will
2379 * single leaf may describe the free space of multiple dmap words,
2381 * to the dmap words of the block range.
2398 * dmap word.
2404 /* update the leaf for this dmap word.
2413 /* one or more dmap words are fully contained
2444 /* get the number of dmap words handled.
2452 /* update the free count for this dmap.
2497 * FUNCTION: adjust a dmap control page at a specified level to reflect
2498 * the change in a lower level dmap or dmap control page's
2501 * or deallocation of a range of blocks with a single dmap.
2504 * the lower level dmap or dmap control page root and the
2513 * if the adjustment of the dmap control page, itself, causes its
2514 * root to change, this change will be bubbled up to the next dmap
2516 * the new root value and the next dmap control page level to
2520 * blkno - the first block of a block range within a dmap. it is
2522 * requires the dmap control page to be adjusted.
2523 * newval - the new value of the lower level dmap or dmap control
2526 * level - current level of dmap control page (i.e. L0, L1, L2) to
2545 /* get the buffer for the dmap control page for the specified
2561 * the index within the dmap control tree.
2604 /* check if the root of the current dmap control page changed due
2605 * to the update and if the current dmap control page is not at
2609 * reflect the change in root for the current dmap control page.
2616 /* bubble up the new root of this dmap control page to
2624 * current dmap control page.
2719 /* adjust the dmap tree to reflect the specified leaf's new
3057 * dmap bitmap word value.
3063 * word - dmap bitmap word value.
3110 * largest binary buddy of free bits within a dmap word.
3235 * the blocks will be alloc from the working map one dmap
3250 struct dmap *dp;
3262 * allocate the blocks a dmap at a time.
3266 /* release previous dmap if any */
3271 /* get the buffer for the current dmap. */
3278 dp = (struct dmap *) mp->data;
3281 * this dmap.
3302 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
3311 * of the dmap tree.
3315 /* determine the bit number and word within the dmap of the
3321 /* block range better be within the dmap */
3324 /* allocate the bits of the dmap's words corresponding to the block
3329 * updating the leaf corresponding to the dmap word. a single pass
3330 * will be used for all dmap words fully contained within the
3332 * dmap words will be marked as free in a single shot and the leaves
3334 * multiple dmap words, so we may update only a subset of the actual
3335 * leaves corresponding to the dmap words of the block range.
3348 * this dmap word.
3355 /* one or more dmap words are fully contained
3369 /* update the free count for this dmap */
3395 /* root changed. bubble the change up to the dmap control pages.
3432 struct dmap *dp;
3447 * the mkfs hidden dmap page.
3563 /* compute start dmap */
3578 /* compute start dmap */
3581 p += nbperpage; /* 1st dmap of L0.j */
3585 * extend each dmap in L0
3589 * reconstruct the dmap page, and
3593 /* read in dmap page: */
3600 /* assign/init dmap page */
3609 dp = (struct dmap *) mp->data;
3625 } /* for each dmap in a L0 */
3772 * FUNCTION: initialize working/persistent bitmap of the dmap page
3786 static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks)
3790 /* starting block number within the dmap */
3877 * FUNCTION: initialize summary tree of the specified dmap:
3879 * at entry, bitmap of the dmap has been initialized;
3882 * dp - dmap to complete
3883 * blkno - starting block number for this dmap
3884 * treemax - will be filled in with max free for this dmap
3888 static int dbInitDmapTree(struct dmap * dp)
3910 /* build the dmap's binary buddy summary tree */
3918 * FUNCTION: initialize binary buddy summary tree of a dmap or dmapctl.
4022 * low level dmapctl or dmap).
4028 /* build the dmap's binary buddy summary tree */
4102 /* At each level, accumulate the number of dmap pages covered by