Lines Matching refs:l2nb
72 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results);
77 int l2nb, s64 * results);
81 int l2nb,
83 static int dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb,
85 static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
88 static int dbFindBits(u32 word, int l2nb);
89 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
90 static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl);
733 int l2nb;
744 l2nb = BLKSTOL2(nblocks);
759 if (l2nb > bmp->db_agl2size) {
762 rc = dbAllocAny(bmp, nblocks, l2nb, results);
843 dbAllocNear(bmp, dp, blkno, (int) nblocks, l2nb, results))
855 if ((rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results))
872 if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) != -ENOSPC)
888 if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) == -ENOSPC)
889 rc = dbAllocAny(bmp, nblocks, l2nb, results);
1270 * l2nb - log2 number of contiguous free blocks desired.
1283 struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results)
1307 if (leaf[word] < l2nb)
1322 dbFindBits(le32_to_cpu(dp->wmap[word]), l2nb);
1379 * l2nb - log2 number of contiguous free blocks desired.
1391 dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1402 if (l2nb > bmp->db_agl2size) {
1432 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1480 if (l2nb > dcp->stree[ti])
1489 if (l2nb <= dcp->stree[m + n]) {
1525 if (l2nb < budmin) {
1532 dbFindCtl(bmp, l2nb, bmp->db_aglevel - 1,
1545 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1578 * l2nb - log2 number of contiguous free blocks desired.
1589 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results)
1600 if ((rc = dbFindCtl(bmp, l2nb, bmp->db_maxlevel, &blkno)))
1605 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1650 int rc, l2nb;
1678 l2nb = BLKSTOL2(nblocks);
1681 rc = dbAllocAG(bmp, agno, nblocks, l2nb, &blkno);
1696 l2nb = BLKSTOL2(nblocks) - 1;
1697 nblocks = 1LL << l2nb;
1740 * l2nb - log2 number of contiguous free blocks desired.
1752 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
1788 rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx, true);
1816 if (l2nb >= budmin)
1857 * l2nb - log2 number of contiguous free blocks to allocate.
1871 dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
1880 if (l2nb <= L2BPERDMAP) {
1891 rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results);
2008 * l2nb - log2 number of contiguous block desired.
2023 struct dmap * dp, int nblocks, int l2nb, s64 * results)
2029 assert(l2nb <= L2BPERDMAP);
2035 if (dbFindLeaf((dmtree_t *) &dp->tree, l2nb, &leafidx, false))
2051 blkno += dbFindBits(le32_to_cpu(dp->wmap[leafidx]), l2nb);
2996 * l2nb - log2 number of free blocks to search for.
2998 * describing at least l2nb free blocks if sufficient
3006 static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl)
3016 if (l2nb > tp->dmt_stree[ROOT])
3034 if (l2nb <= tp->dmt_stree[x + n])
3059 * this routine searches the bitmap value for (1 << l2nb) free
3060 * bits at (1 << l2nb) alignments within the value.
3064 * l2nb - number of free bits specified as a log2 number.
3069 static int dbFindBits(u32 word, int l2nb)
3076 nb = 1 << l2nb;
3201 int l2nb;
3208 for (l2nb = 0; l2nb < 64; l2nb++, mask >>= 1) {
3214 l2nb = (64 - 1) - l2nb;
3219 l2nb++;
3221 return (l2nb);