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);
703 int l2nb; in dbAlloc() local
714 l2nb = BLKSTOL2(nblocks); in dbAlloc()
729 if (l2nb > bmp->db_agl2size) { in dbAlloc()
732 rc = dbAllocAny(bmp, nblocks, l2nb, results); in dbAlloc()
813 dbAllocNear(bmp, dp, blkno, (int) nblocks, l2nb, results)) in dbAlloc()
825 if ((rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results)) in dbAlloc()
842 if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) != -ENOSPC) in dbAlloc()
858 if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) == -ENOSPC) in dbAlloc()
859 rc = dbAllocAny(bmp, nblocks, l2nb, results); in dbAlloc()
1185 struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results) in dbAllocNear() argument
1209 if (leaf[word] < l2nb) in dbAllocNear()
1224 dbFindBits(le32_to_cpu(dp->wmap[word]), l2nb); in dbAllocNear()
1293 dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results) in dbAllocAG() argument
1304 if (l2nb > bmp->db_agl2size) { in dbAllocAG()
1334 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAG()
1382 if (l2nb > dcp->stree[ti]) in dbAllocAG()
1391 if (l2nb <= dcp->stree[m + n]) { in dbAllocAG()
1427 if (l2nb < budmin) { in dbAllocAG()
1434 dbFindCtl(bmp, l2nb, bmp->db_aglevel - 1, in dbAllocAG()
1447 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAG()
1491 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results) in dbAllocAny() argument
1502 if ((rc = dbFindCtl(bmp, l2nb, bmp->db_maxlevel, &blkno))) in dbAllocAny()
1507 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAny()
1552 int rc, l2nb; in dbDiscardAG() local
1580 l2nb = BLKSTOL2(nblocks); in dbDiscardAG()
1583 rc = dbAllocAG(bmp, agno, nblocks, l2nb, &blkno); in dbDiscardAG()
1598 l2nb = BLKSTOL2(nblocks) - 1; in dbDiscardAG()
1599 nblocks = 1LL << l2nb; in dbDiscardAG()
1654 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno) in dbFindCtl() argument
1690 rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx); in dbFindCtl()
1718 if (l2nb >= budmin) in dbFindCtl()
1773 dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results) in dbAllocCtl() argument
1782 if (l2nb <= L2BPERDMAP) { in dbAllocCtl()
1793 rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results); in dbAllocCtl()
1925 struct dmap * dp, int nblocks, int l2nb, s64 * results) in dbAllocDmapLev() argument
1931 assert(l2nb <= L2BPERDMAP); in dbAllocDmapLev()
1937 if (dbFindLeaf((dmtree_t *) & dp->tree, l2nb, &leafidx)) in dbAllocDmapLev()
1950 blkno += dbFindBits(le32_to_cpu(dp->wmap[leafidx]), l2nb); in dbAllocDmapLev()
2903 static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx) in dbFindLeaf() argument
2910 if (l2nb > tp->dmt_stree[ROOT]) in dbFindLeaf()
2926 if (l2nb <= tp->dmt_stree[x + n]) in dbFindLeaf()
2961 static int dbFindBits(u32 word, int l2nb) in dbFindBits() argument
2968 nb = 1 << l2nb; in dbFindBits()
3093 int l2nb; in blkstol2() local
3100 for (l2nb = 0; l2nb < 64; l2nb++, mask >>= 1) { in blkstol2()
3106 l2nb = (64 - 1) - l2nb; in blkstol2()
3111 l2nb++; in blkstol2()
3113 return (l2nb); in blkstol2()