Lines Matching defs: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);
1202 * l2nb - log2 number of contiguous free blocks desired.
1215 struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results)
1239 if (leaf[word] < l2nb)
1254 dbFindBits(le32_to_cpu(dp->wmap[word]), l2nb);
1311 * l2nb - log2 number of contiguous free blocks desired.
1323 dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1334 if (l2nb > bmp->db_agl2size) {
1364 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1412 if (l2nb > dcp->stree[ti])
1421 if (l2nb <= dcp->stree[m + n]) {
1457 if (l2nb < budmin) {
1464 dbFindCtl(bmp, l2nb, bmp->db_aglevel - 1,
1477 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1510 * l2nb - log2 number of contiguous free blocks desired.
1521 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results)
1532 if ((rc = dbFindCtl(bmp, l2nb, bmp->db_maxlevel, &blkno)))
1537 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1582 int rc, l2nb;
1610 l2nb = BLKSTOL2(nblocks);
1613 rc = dbAllocAG(bmp, agno, nblocks, l2nb, &blkno);
1628 l2nb = BLKSTOL2(nblocks) - 1;
1629 nblocks = 1LL << l2nb;
1672 * l2nb - log2 number of contiguous free blocks desired.
1684 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
1720 rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx, true);
1748 if (l2nb >= budmin)
1789 * l2nb - log2 number of contiguous free blocks to allocate.
1803 dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
1812 if (l2nb <= L2BPERDMAP) {
1823 rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results);
1940 * l2nb - log2 number of contiguous block desired.
1955 struct dmap * dp, int nblocks, int l2nb, s64 * results)
1961 assert(l2nb <= L2BPERDMAP);
1967 if (dbFindLeaf((dmtree_t *) &dp->tree, l2nb, &leafidx, false))
1983 blkno += dbFindBits(le32_to_cpu(dp->wmap[leafidx]), l2nb);
2932 * l2nb - log2 number of free blocks to search for.
2934 * describing at least l2nb free blocks if sufficient
2942 static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl)
2952 if (l2nb > tp->dmt_stree[ROOT])
2970 if (l2nb <= tp->dmt_stree[x + n])
2995 * this routine searches the bitmap value for (1 << l2nb) free
2996 * bits at (1 << l2nb) alignments within the value.
3000 * l2nb - number of free bits specified as a log2 number.
3005 static int dbFindBits(u32 word, int l2nb)
3012 nb = 1 << l2nb;
3137 int l2nb;
3144 for (l2nb = 0; l2nb < 64; l2nb++, mask >>= 1) {
3150 l2nb = (64 - 1) - l2nb;
3155 l2nb++;
3157 return (l2nb);