• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/jfs/

Lines Matching refs:blkno

74 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
80 static int dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc,
83 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
85 static int dbAllocNear(struct bmap * bmp, struct dmap * dp, s64 blkno,
88 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
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);
99 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
101 static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
103 static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
112 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
114 static int dbInitDmap(struct dmap * dp, s64 blkno, int nblocks);
324 * blkno - starting block number to be freed.
331 int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
343 if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) {
345 printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
346 (unsigned long long) blkno,
357 for (rem = nblocks; rem > 0; rem -= nb, blkno += nb) {
364 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
375 nb = min(rem, BPERDMAP - (blkno & (BPERDMAP - 1)));
378 if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) {
408 * blkno - starting block number of the range.
418 int free, s64 blkno, s64 nblocks, struct tblock * tblk)
432 if (blkno + nblocks > bmp->db_mapsize) {
433 printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
434 (unsigned long long) blkno,
451 for (rem = nblocks; rem > 0; rem -= nblks, blkno += nblks) {
453 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
471 dbitno = blkno & (BPERDMAP - 1);
700 s64 lblkno, blkno;
753 blkno = hint + 1;
755 if (blkno >= bmp->db_mapsize)
758 agno = blkno >> bmp->db_agl2size;
760 /* check if blkno crosses over into a new allocation group.
764 if ((blkno & (bmp->db_agsize - 1)) == 0)
782 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
792 if ((rc = dbAllocNext(bmp, dp, blkno, (int) nblocks))
795 *results = blkno;
819 dbAllocNear(bmp, dp, blkno, (int) nblocks, l2nb, results))
886 * blkno - extent address;
894 int dbAllocExact(struct inode *ip, s64 blkno, int nblocks)
912 if (nblocks <= 0 || nblocks > BPERDMAP || blkno >= bmp->db_mapsize) {
924 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
933 rc = dbAllocNext(bmp, dp, blkno, nblocks);
963 * blkno - starting block of the current allocation.
980 s64 blkno, s64 nblocks, s64 addnblocks, s64 * results)
986 if ((rc = dbExtend(ip, blkno, nblocks, addnblocks)) == 0) {
987 *results = blkno;
1000 (ip, blkno + nblocks - 1, addnblocks + nblocks, results));
1017 * blkno - starting block of the current allocation.
1027 static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
1041 if (((rel_block = blkno & (sbi->nbperpage - 1))) &&
1046 lastblkno = blkno + nblocks - 1;
1118 * blkno - starting block number of the range.
1128 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
1149 dbitno = blkno & (BPERDMAP - 1);
1229 return (dbAllocDmap(bmp, dp, blkno, nblocks));
1247 * blkno - block number to allocate near.
1262 struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results)
1276 * (i.e. blkno). also, determine the last word in the dmap
1279 word = (blkno & (BPERDMAP - 1)) >> L2DBWORD;
1293 blkno = le64_to_cpu(dp->start) + (word << L2DBWORD);
1301 blkno +=
1306 if ((rc = dbAllocDmap(bmp, dp, blkno, nblocks)) == 0)
1307 *results = blkno;
1376 s64 blkno, lblkno;
1392 blkno = (s64) agno << bmp->db_agl2size;
1413 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1416 printk(KERN_ERR "blkno = %Lx, blocks = %Lx\n",
1417 (unsigned long long) blkno,
1428 lblkno = BLKTOCTL(blkno, bmp->db_l2nbperpage, bmp->db_aglevel);
1488 blkno = 0;
1490 blkno &= ~(MAXL1SIZE - 1);
1492 blkno &= ~(MAXL0SIZE - 1);
1494 blkno +=
1515 &blkno))) {
1528 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1575 s64 blkno = 0;
1583 if ((rc = dbFindCtl(bmp, l2nb, bmp->db_maxlevel, &blkno)))
1588 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1615 * *blkno - on entry, starting block number for conducting the search.
1626 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
1639 for (lev = level, b = *blkno; lev >= 0; lev--) {
1694 *blkno = b;
1726 * first dmap (i.e. blkno).
1732 * blkno - starting block number of the dmap to start the allocation
1745 dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
1757 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
1777 assert((blkno & (BPERDMAP - 1)) == 0);
1781 for (n = nblocks, b = blkno; n > 0; n -= nb, b += nb) {
1820 *results = blkno;
1833 for (n = nblocks - n, b = blkno; n > 0;
1900 s64 blkno;
1916 blkno = le64_to_cpu(dp->start) + (leafidx << L2DBWORD);
1923 blkno += dbFindBits(le32_to_cpu(dp->wmap[leafidx]), l2nb);
1926 if ((rc = dbAllocDmap(bmp, dp, blkno, nblocks)) == 0)
1927 *results = blkno;
1951 * blkno - starting block number of the block to be allocated.
1960 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
1972 dbAllocBits(bmp, dp, blkno, nblocks);
1982 if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 1, 0)))
1983 dbFreeBits(bmp, dp, blkno, nblocks);
2006 * blkno - starting block number of the block to be freed.
2015 static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
2027 rc = dbFreeBits(bmp, dp, blkno, nblocks);
2037 if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 0, 0))) {
2038 word = (blkno & (BPERDMAP - 1)) >> L2DBWORD;
2048 dbAllocBits(bmp, dp, blkno, nblocks);
2070 * blkno - starting block number of the bits to be allocated.
2077 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
2091 dbitno = blkno & (BPERDMAP - 1);
2190 agno = blkno >> bmp->db_agl2size;
2217 * blkno - starting block number of the bits to be freed.
2224 static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
2235 dbitno = blkno & (BPERDMAP - 1);
2333 agno = blkno >> bmp->db_agl2size;
2392 * blkno - the first block of a block range within a dmap. it is
2408 dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
2420 lblkno = BLKTOCTL(blkno, bmp->db_l2nbperpage, level);
2436 leafno = BLKTOCTLLEAF(blkno, dcp->budmin);
2493 dbAdjCtl(bmp, blkno, dcp->stree[ROOT], alloc,
3103 * blkno - starting block number to be freed.
3110 int dbAllocBottomUp(struct inode *ip, s64 blkno, s64 nblocks)
3122 ASSERT(nblocks <= bmp->db_mapsize - blkno);
3128 for (rem = nblocks; rem > 0; rem -= nb, blkno += nb) {
3135 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);
3146 nb = min(rem, BPERDMAP - (blkno & (BPERDMAP - 1)));
3149 if ((rc = dbAllocDmapBU(bmp, dp, blkno, nb))) {
3165 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
3184 dbitno = blkno & (BPERDMAP - 1);
3247 agno = blkno >> bmp->db_agl2size;
3265 if ((rc = dbAdjCtl(bmp, blkno, tp->stree[ROOT], 1, 0)))
3266 dbFreeBits(bmp, dp, blkno, nblocks);
3275 * FUNCTION: extend bmap from blkno for nblocks;
3289 int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
3304 newsize = blkno + nblocks;
3306 jfs_info("dbExtendFS: blkno:%Ld nblocks:%Ld newsize:%Ld",
3307 (long long) blkno, (long long) nblocks, (long long) newsize);
3381 k = blkno >> L2MAXL1SIZE;
3383 p = BLKTOL1(blkno, sbi->l2nbperpage); /* L1 page */
3391 /* read in L1 page: (blkno & (MAXL1SIZE - 1)) */
3398 j = (blkno & (MAXL1SIZE - 1)) >> L2MAXL0SIZE;
3400 p = BLKTOL0(blkno, sbi->l2nbperpage);
3422 /* read in L0 page: (blkno & (MAXL0SIZE - 1)) */
3430 i = (blkno & (MAXL0SIZE - 1)) >>
3433 p = BLKTODMAP(blkno,
3458 if ((n = blkno & (BPERDMAP - 1))) {
3476 *l0leaf = dbInitDmap(dp, blkno, n);
3487 blkno += n;
3655 int blkno, w, b, r, nw, nb, i;
3658 blkno = Blkno & (BPERDMAP - 1);
3660 if (blkno == 0) {
3676 w = blkno >> L2DBWORD;
3683 for (r = nblocks; r > 0; r -= nb, blkno += nb) {
3685 b = blkno & (DBWORD - 1);
3716 if (blkno == BPERDMAP)
3720 w = blkno >> L2DBWORD;
3723 b = blkno & (DBWORD - 1);
3751 * blkno - starting block number for this dmap