Lines Matching refs:nblocks
75 int nblocks);
82 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results);
84 int nblocks);
86 int nblocks,
89 int nblocks);
90 static int dbAllocDmapLev(struct bmap * bmp, struct dmap * dp, int nblocks,
93 static int dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb,
95 static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
97 static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
102 int nblocks);
104 int nblocks);
113 int nblocks);
114 static int dbInitDmap(struct dmap * dp, s64 blkno, int nblocks);
118 static int dbGetL2AGSize(s64 nblocks);
331 int dbFree(struct inode *ip, s64 blkno, s64 nblocks) in dbFree() argument
343 if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) { in dbFree()
347 (unsigned long long) nblocks); in dbFree()
357 for (rem = nblocks; rem > 0; rem -= nb, blkno += nb) { in dbFree()
418 int free, s64 blkno, s64 nblocks, struct tblock * tblk) in dbUpdatePMap() argument
432 if (blkno + nblocks > bmp->db_mapsize) { in dbUpdatePMap()
435 (unsigned long long) nblocks); in dbUpdatePMap()
451 for (rem = nblocks; rem > 0; rem -= nblks, blkno += nblks) { in dbUpdatePMap()
694 int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results) in dbAlloc() argument
707 assert(nblocks > 0); in dbAlloc()
713 l2nb = BLKSTOL2(nblocks); in dbAlloc()
731 rc = dbAllocAny(bmp, nblocks, l2nb, results); in dbAlloc()
769 if (nblocks <= BPERDMAP) { in dbAlloc()
785 if ((rc = dbAllocNext(bmp, dp, blkno, (int) nblocks)) in dbAlloc()
812 dbAllocNear(bmp, dp, blkno, (int) nblocks, l2nb, results)) in dbAlloc()
824 if ((rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results)) in dbAlloc()
841 if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) != -ENOSPC) in dbAlloc()
857 if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) == -ENOSPC) in dbAlloc()
858 rc = dbAllocAny(bmp, nblocks, l2nb, results); in dbAlloc()
887 int dbAllocExact(struct inode *ip, s64 blkno, int nblocks) in dbAllocExact() argument
905 if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) { in dbAllocExact()
910 if (nblocks > ((s64) 1 << bmp->db_maxfreebud)) { in dbAllocExact()
926 rc = dbAllocNext(bmp, dp, blkno, nblocks); in dbAllocExact()
973 s64 blkno, s64 nblocks, s64 addnblocks, s64 * results) in dbReAlloc() argument
979 if ((rc = dbExtend(ip, blkno, nblocks, addnblocks)) == 0) { in dbReAlloc()
993 (ip, blkno + nblocks - 1, addnblocks + nblocks, results)); in dbReAlloc()
1020 static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks) in dbExtend() argument
1035 (rel_block + nblocks + addnblocks > sbi->nbperpage)) in dbExtend()
1039 lastblkno = blkno + nblocks - 1; in dbExtend()
1122 int nblocks) in dbAllocNext() argument
1148 if (dbitno + nblocks > BPERDMAP) in dbAllocNext()
1170 for (rembits = nblocks; rembits > 0; rembits -= nb, dbitno += nb) { in dbAllocNext()
1222 return (dbAllocDmap(bmp, dp, blkno, nblocks)); in dbAllocNext()
1255 struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results) in dbAllocNear() argument
1299 if ((rc = dbAllocDmap(bmp, dp, blkno, nblocks)) == 0) in dbAllocNear()
1364 dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results) in dbAllocAG() argument
1406 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAG()
1411 (unsigned long long) nblocks); in dbAllocAG()
1521 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAG()
1565 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results) in dbAllocAny() argument
1581 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAny()
1738 dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results) in dbAllocCtl() argument
1758 rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results); in dbAllocCtl()
1774 for (n = nblocks, b = blkno; n > 0; n -= nb, b += nb) { in dbAllocCtl()
1826 for (n = nblocks - n, b = blkno; n > 0; in dbAllocCtl()
1891 struct dmap * dp, int nblocks, int l2nb, s64 * results) in dbAllocDmapLev() argument
1919 if ((rc = dbAllocDmap(bmp, dp, blkno, nblocks)) == 0) in dbAllocDmapLev()
1954 int nblocks) in dbAllocDmap() argument
1965 dbAllocBits(bmp, dp, blkno, nblocks); in dbAllocDmap()
1976 dbFreeBits(bmp, dp, blkno, nblocks); in dbAllocDmap()
2009 int nblocks) in dbFreeDmap() argument
2020 rc = dbFreeBits(bmp, dp, blkno, nblocks); in dbFreeDmap()
2041 dbAllocBits(bmp, dp, blkno, nblocks); in dbFreeDmap()
2071 int nblocks) in dbAllocBits() argument
2088 assert(dbitno + nblocks <= BPERDMAP); in dbAllocBits()
2103 for (rembits = nblocks; rembits > 0; rembits -= nb, dbitno += nb) { in dbAllocBits()
2175 le32_add_cpu(&dp->nfree, -nblocks); in dbAllocBits()
2188 bmp->db_agfree[agno] -= nblocks; in dbAllocBits()
2189 bmp->db_nfree -= nblocks; in dbAllocBits()
2218 int nblocks) in dbFreeBits() argument
2233 assert(dbitno + nblocks <= BPERDMAP); in dbFreeBits()
2252 for (rembits = nblocks; rembits > 0; rembits -= nb, dbitno += nb) { in dbFreeBits()
2319 le32_add_cpu(&dp->nfree, nblocks); in dbFreeBits()
2327 bmp->db_nfree += nblocks; in dbFreeBits()
2328 bmp->db_agfree[agno] += nblocks; in dbFreeBits()
3103 int dbAllocBottomUp(struct inode *ip, s64 blkno, s64 nblocks) in dbAllocBottomUp() argument
3115 ASSERT(nblocks <= bmp->db_mapsize - blkno); in dbAllocBottomUp()
3121 for (rem = nblocks; rem > 0; rem -= nb, blkno += nb) { in dbAllocBottomUp()
3159 int nblocks) in dbAllocDmapBU() argument
3181 assert(dbitno + nblocks <= BPERDMAP); in dbAllocDmapBU()
3196 for (rembits = nblocks; rembits > 0; rembits -= nb, dbitno += nb) { in dbAllocDmapBU()
3229 le32_add_cpu(&dp->nfree, -nblocks); in dbAllocDmapBU()
3245 bmp->db_agfree[agno] -= nblocks; in dbAllocDmapBU()
3246 bmp->db_nfree -= nblocks; in dbAllocDmapBU()
3259 dbFreeBits(bmp, dp, blkno, nblocks); in dbAllocDmapBU()
3282 int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) in dbExtendFS() argument
3297 newsize = blkno + nblocks; in dbExtendFS()
3300 (long long) blkno, (long long) nblocks, (long long) newsize); in dbExtendFS()
3457 n = min(nblocks, (s64)BPERDMAP - n); in dbExtendFS()
3465 n = min(nblocks, (s64)BPERDMAP); in dbExtendFS()
3481 nblocks -= n; in dbExtendFS()
3482 if (nblocks == 0) in dbExtendFS()
3494 if (nblocks) in dbExtendFS()
3518 if (nblocks) in dbExtendFS()
3646 static int dbInitDmap(struct dmap * dp, s64 Blkno, int nblocks) in dbInitDmap() argument
3654 dp->nblocks = dp->nfree = cpu_to_le32(nblocks); in dbInitDmap()
3657 if (nblocks == BPERDMAP) { in dbInitDmap()
3663 le32_add_cpu(&dp->nblocks, nblocks); in dbInitDmap()
3664 le32_add_cpu(&dp->nfree, nblocks); in dbInitDmap()
3675 for (r = nblocks; r > 0; r -= nb, blkno += nb) { in dbInitDmap()
3903 static int dbGetL2AGSize(s64 nblocks) in dbGetL2AGSize() argument
3909 if (nblocks < BPERDMAP * MAXAG) in dbGetL2AGSize()
3915 if (m & nblocks) in dbGetL2AGSize()
3920 if (sz < nblocks) in dbGetL2AGSize()
3954 s64 nblocks; in dbMapFileSizeToMapSize() local
3959 nblocks = ipbmap->i_size >> JFS_SBI(sb)->l2bsize; in dbMapFileSizeToMapSize()
3960 npages = nblocks >> JFS_SBI(sb)->l2nbperpage; in dbMapFileSizeToMapSize()
3988 nblocks = ndmaps << L2BPERDMAP; in dbMapFileSizeToMapSize()
3990 return (nblocks); in dbMapFileSizeToMapSize()