Lines Matching refs:bmp
57 #define BMAP_LOCK_INIT(bmp) mutex_init(&bmp->db_bmaplock) argument
58 #define BMAP_LOCK(bmp) mutex_lock(&bmp->db_bmaplock) argument
59 #define BMAP_UNLOCK(bmp) mutex_unlock(&bmp->db_bmaplock) argument
64 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
70 static int dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc,
72 static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results);
73 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
75 static int dbAllocNear(struct bmap * bmp, struct dmap * dp, s64 blkno,
78 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
80 static int dbAllocDmapLev(struct bmap * bmp, struct dmap * dp, int nblocks,
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,
89 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
91 static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
93 static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
101 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno,
155 struct bmap *bmp; in dbMount() local
164 bmp = kmalloc(sizeof(struct bmap), GFP_KERNEL); in dbMount()
165 if (bmp == NULL) in dbMount()
173 kfree(bmp); in dbMount()
179 bmp->db_mapsize = le64_to_cpu(dbmp_le->dn_mapsize); in dbMount()
180 bmp->db_nfree = le64_to_cpu(dbmp_le->dn_nfree); in dbMount()
181 bmp->db_l2nbperpage = le32_to_cpu(dbmp_le->dn_l2nbperpage); in dbMount()
182 bmp->db_numag = le32_to_cpu(dbmp_le->dn_numag); in dbMount()
183 if (!bmp->db_numag) { in dbMount()
185 kfree(bmp); in dbMount()
189 bmp->db_maxlevel = le32_to_cpu(dbmp_le->dn_maxlevel); in dbMount()
190 bmp->db_maxag = le32_to_cpu(dbmp_le->dn_maxag); in dbMount()
191 bmp->db_agpref = le32_to_cpu(dbmp_le->dn_agpref); in dbMount()
192 bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel); in dbMount()
193 bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight); in dbMount()
194 bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth); in dbMount()
195 bmp->db_agstart = le32_to_cpu(dbmp_le->dn_agstart); in dbMount()
196 bmp->db_agl2size = le32_to_cpu(dbmp_le->dn_agl2size); in dbMount()
198 bmp->db_agfree[i] = le64_to_cpu(dbmp_le->dn_agfree[i]); in dbMount()
199 bmp->db_agsize = le64_to_cpu(dbmp_le->dn_agsize); in dbMount()
200 bmp->db_maxfreebud = dbmp_le->dn_maxfreebud; in dbMount()
206 bmp->db_ipbmap = ipbmap; in dbMount()
207 JFS_SBI(ipbmap->i_sb)->bmap = bmp; in dbMount()
209 memset(bmp->db_active, 0, sizeof(bmp->db_active)); in dbMount()
214 BMAP_LOCK_INIT(bmp); in dbMount()
238 struct bmap *bmp = JFS_SBI(ipbmap->i_sb)->bmap; in dbUnmount() local
249 kfree(bmp); in dbUnmount()
260 struct bmap *bmp = JFS_SBI(ipbmap->i_sb)->bmap; in dbSync() local
277 dbmp_le->dn_mapsize = cpu_to_le64(bmp->db_mapsize); in dbSync()
278 dbmp_le->dn_nfree = cpu_to_le64(bmp->db_nfree); in dbSync()
279 dbmp_le->dn_l2nbperpage = cpu_to_le32(bmp->db_l2nbperpage); in dbSync()
280 dbmp_le->dn_numag = cpu_to_le32(bmp->db_numag); in dbSync()
281 dbmp_le->dn_maxlevel = cpu_to_le32(bmp->db_maxlevel); in dbSync()
282 dbmp_le->dn_maxag = cpu_to_le32(bmp->db_maxag); in dbSync()
283 dbmp_le->dn_agpref = cpu_to_le32(bmp->db_agpref); in dbSync()
284 dbmp_le->dn_aglevel = cpu_to_le32(bmp->db_aglevel); in dbSync()
285 dbmp_le->dn_agheight = cpu_to_le32(bmp->db_agheight); in dbSync()
286 dbmp_le->dn_agwidth = cpu_to_le32(bmp->db_agwidth); in dbSync()
287 dbmp_le->dn_agstart = cpu_to_le32(bmp->db_agstart); in dbSync()
288 dbmp_le->dn_agl2size = cpu_to_le32(bmp->db_agl2size); in dbSync()
290 dbmp_le->dn_agfree[i] = cpu_to_le64(bmp->db_agfree[i]); in dbSync()
291 dbmp_le->dn_agsize = cpu_to_le64(bmp->db_agsize); in dbSync()
292 dbmp_le->dn_maxfreebud = bmp->db_maxfreebud; in dbSync()
332 struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap; in dbFree() local
338 if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) { in dbFree()
365 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage); in dbFree()
379 if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) { in dbFree()
424 struct bmap *bmp = JFS_SBI(ipbmap->i_sb)->bmap; in dbUpdatePMap() local
434 if (blkno + nblocks > bmp->db_mapsize) { in dbUpdatePMap()
454 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage); in dbUpdatePMap()
460 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, in dbUpdatePMap()
605 struct bmap *bmp = JFS_SBI(ipbmap->i_sb)->bmap; in dbNextAG() local
607 BMAP_LOCK(bmp); in dbNextAG()
610 avgfree = (u32)bmp->db_nfree / bmp->db_numag; in dbNextAG()
616 agpref = bmp->db_agpref; in dbNextAG()
617 if ((atomic_read(&bmp->db_active[agpref]) == 0) && in dbNextAG()
618 (bmp->db_agfree[agpref] >= avgfree)) in dbNextAG()
624 for (i = 0 ; i < bmp->db_numag; i++, agpref++) { in dbNextAG()
625 if (agpref == bmp->db_numag) in dbNextAG()
628 if (atomic_read(&bmp->db_active[agpref])) in dbNextAG()
631 if (bmp->db_agfree[agpref] >= avgfree) { in dbNextAG()
633 bmp->db_agpref = agpref; in dbNextAG()
635 } else if (bmp->db_agfree[agpref] > hwm) { in dbNextAG()
637 hwm = bmp->db_agfree[agpref]; in dbNextAG()
647 bmp->db_agpref = next_best; in dbNextAG()
650 BMAP_UNLOCK(bmp); in dbNextAG()
654 return (bmp->db_agpref); in dbNextAG()
699 struct bmap *bmp; in dbAlloc() local
716 bmp = JFS_SBI(ip->i_sb)->bmap; in dbAlloc()
718 mapSize = bmp->db_mapsize; in dbAlloc()
729 if (l2nb > bmp->db_agl2size) { in dbAlloc()
732 rc = dbAllocAny(bmp, nblocks, l2nb, results); in dbAlloc()
749 if (blkno >= bmp->db_mapsize) in dbAlloc()
752 agno = blkno >> bmp->db_agl2size; in dbAlloc()
758 if ((blkno & (bmp->db_agsize - 1)) == 0) in dbAlloc()
763 if (atomic_read(&bmp->db_active[agno])) in dbAlloc()
776 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage); in dbAlloc()
786 if ((rc = dbAllocNext(bmp, dp, blkno, (int) nblocks)) in dbAlloc()
797 writers = atomic_read(&bmp->db_active[agno]); 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()
962 struct bmap *bmp; in dbExtend() local
982 bmp = sbi->bmap; in dbExtend()
983 if (lastblkno < 0 || lastblkno >= bmp->db_mapsize) { in dbExtend()
997 if (addnblocks > BPERDMAP || extblkno >= bmp->db_mapsize || in dbExtend()
998 (extblkno & (bmp->db_agsize - 1)) == 0) { in dbExtend()
1006 lblkno = BLKTODMAP(extblkno, bmp->db_l2nbperpage); in dbExtend()
1018 rc = dbAllocNext(bmp, dp, extblkno, (int) addnblocks); in dbExtend()
1052 static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno, in dbAllocNext() argument
1061 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n"); in dbAllocNext()
1152 return (dbAllocDmap(bmp, dp, blkno, nblocks)); in dbAllocNext()
1184 dbAllocNear(struct bmap * bmp, in dbAllocNear() argument
1191 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n"); in dbAllocNear()
1228 if ((rc = dbAllocDmap(bmp, dp, blkno, nblocks)) == 0) 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()
1305 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocAG()
1313 blkno = (s64) agno << bmp->db_agl2size; in dbAllocAG()
1332 if (bmp->db_agsize == BPERDMAP in dbAllocAG()
1333 || bmp->db_agfree[agno] == bmp->db_agsize) { in dbAllocAG()
1334 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAG()
1336 (bmp->db_agfree[agno] == bmp->db_agsize)) { in dbAllocAG()
1340 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocAG()
1349 lblkno = BLKTOCTL(blkno, bmp->db_l2nbperpage, bmp->db_aglevel); in dbAllocAG()
1350 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, 0); in dbAllocAG()
1357 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n"); in dbAllocAG()
1370 (1 << (L2LPERCTL - (bmp->db_agheight << 1))) / bmp->db_agwidth; in dbAllocAG()
1371 ti = bmp->db_agstart + bmp->db_agwidth * (agno & (agperlev - 1)); in dbAllocAG()
1379 for (i = 0; i < bmp->db_agwidth; i++, ti++) { in dbAllocAG()
1389 for (k = bmp->db_agheight; k > 0; k--) { in dbAllocAG()
1397 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocAG()
1407 if (bmp->db_aglevel == 2) in dbAllocAG()
1409 else if (bmp->db_aglevel == 1) in dbAllocAG()
1434 dbFindCtl(bmp, l2nb, bmp->db_aglevel - 1, in dbAllocAG()
1437 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocAG()
1447 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); in dbAllocAG()
1449 jfs_error(bmp->db_ipbmap->i_sb, 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()
1509 jfs_error(bmp->db_ipbmap->i_sb, "unable to allocate blocks\n"); in dbAllocAny()
1549 struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap; in dbDiscardAG() local
1567 nblocks = bmp->db_agfree[agno]; in dbDiscardAG()
1573 jfs_error(bmp->db_ipbmap->i_sb, "no memory for trim array\n"); in dbDiscardAG()
1583 rc = dbAllocAG(bmp, agno, nblocks, l2nb, &blkno); in dbDiscardAG()
1590 if (bmp->db_agfree[agno] == 0) in dbDiscardAG()
1594 nblocks = bmp->db_agfree[agno]; in dbDiscardAG()
1602 jfs_error(bmp->db_ipbmap->i_sb, "-EIO\n"); in dbDiscardAG()
1654 static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno) in dbFindCtl() argument
1671 lblkno = BLKTOCTL(b, bmp->db_l2nbperpage, lev); in dbFindCtl()
1672 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, 0); in dbFindCtl()
1679 jfs_error(bmp->db_ipbmap->i_sb, in dbFindCtl()
1700 jfs_error(bmp->db_ipbmap->i_sb, in dbFindCtl()
1773 dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results) in dbAllocCtl() argument
1785 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage); in dbAllocCtl()
1786 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, 0); in dbAllocCtl()
1793 rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results); in dbAllocCtl()
1812 lblkno = BLKTODMAP(b, bmp->db_l2nbperpage); in dbAllocCtl()
1813 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, 0); in dbAllocCtl()
1824 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocCtl()
1836 if ((rc = dbAllocDmap(bmp, dp, b, nb))) { in dbAllocCtl()
1865 lblkno = BLKTODMAP(b, bmp->db_l2nbperpage); in dbAllocCtl()
1866 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, 0); in dbAllocCtl()
1871 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocCtl()
1879 if (dbFreeDmap(bmp, dp, b, BPERDMAP)) { in dbAllocCtl()
1884 jfs_error(bmp->db_ipbmap->i_sb, "Block Leakage\n"); in dbAllocCtl()
1924 dbAllocDmapLev(struct bmap * bmp, in dbAllocDmapLev() argument
1953 if ((rc = dbAllocDmap(bmp, dp, blkno, nblocks)) == 0) in dbAllocDmapLev()
1987 static int dbAllocDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, in dbAllocDmap() argument
1999 dbAllocBits(bmp, dp, blkno, nblocks); in dbAllocDmap()
2009 if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 1, 0))) in dbAllocDmap()
2010 dbFreeBits(bmp, dp, blkno, nblocks); in dbAllocDmap()
2042 static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, in dbFreeDmap() argument
2054 rc = dbFreeBits(bmp, dp, blkno, nblocks); in dbFreeDmap()
2064 if ((rc = dbAdjCtl(bmp, blkno, dp->tree.stree[ROOT], 0, 0))) { in dbFreeDmap()
2075 dbAllocBits(bmp, dp, blkno, nblocks); in dbFreeDmap()
2104 static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno, in dbAllocBits() argument
2180 jfs_error(bmp->db_ipbmap->i_sb, in dbAllocBits()
2211 BMAP_LOCK(bmp); in dbAllocBits()
2217 agno = blkno >> bmp->db_agl2size; in dbAllocBits()
2218 if (agno > bmp->db_maxag) in dbAllocBits()
2219 bmp->db_maxag = agno; in dbAllocBits()
2222 bmp->db_agfree[agno] -= nblocks; in dbAllocBits()
2223 bmp->db_nfree -= nblocks; in dbAllocBits()
2225 BMAP_UNLOCK(bmp); in dbAllocBits()
2251 static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, in dbFreeBits() argument
2355 BMAP_LOCK(bmp); in dbFreeBits()
2360 agno = blkno >> bmp->db_agl2size; in dbFreeBits()
2361 bmp->db_nfree += nblocks; in dbFreeBits()
2362 bmp->db_agfree[agno] += nblocks; in dbFreeBits()
2369 if ((bmp->db_agfree[agno] == bmp->db_agsize && agno == bmp->db_maxag) || in dbFreeBits()
2370 (agno == bmp->db_numag - 1 && in dbFreeBits()
2371 bmp->db_agfree[agno] == (bmp-> db_mapsize & (BPERDMAP - 1)))) { in dbFreeBits()
2372 while (bmp->db_maxag > 0) { in dbFreeBits()
2373 bmp->db_maxag -= 1; in dbFreeBits()
2374 if (bmp->db_agfree[bmp->db_maxag] != in dbFreeBits()
2375 bmp->db_agsize) in dbFreeBits()
2383 if (bmp->db_agpref > bmp->db_maxag) in dbFreeBits()
2384 bmp->db_agpref = bmp->db_maxag; in dbFreeBits()
2387 BMAP_UNLOCK(bmp); in dbFreeBits()
2435 dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level) in dbAdjCtl() argument
2447 lblkno = BLKTOCTL(blkno, bmp->db_l2nbperpage, level); in dbAdjCtl()
2448 mp = read_metapage(bmp->db_ipbmap, lblkno, PSIZE, 0); in dbAdjCtl()
2454 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n"); in dbAdjCtl()
2518 if (level < bmp->db_maxlevel) { in dbAdjCtl()
2523 dbAdjCtl(bmp, blkno, dcp->stree[ROOT], alloc, in dbAdjCtl()
2556 assert(level == bmp->db_maxlevel); in dbAdjCtl()
2557 if (bmp->db_maxfreebud != oldroot) { in dbAdjCtl()
2558 jfs_error(bmp->db_ipbmap->i_sb, in dbAdjCtl()
2561 bmp->db_maxfreebud = dcp->stree[ROOT]; in dbAdjCtl()
3146 struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap; in dbAllocBottomUp() local
3151 ASSERT(nblocks <= bmp->db_mapsize - blkno); in dbAllocBottomUp()
3164 lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage); in dbAllocBottomUp()
3178 if ((rc = dbAllocDmapBU(bmp, dp, blkno, nb))) { in dbAllocBottomUp()
3194 static int dbAllocDmapBU(struct bmap * bmp, struct dmap * dp, s64 blkno, in dbAllocDmapBU() argument
3267 BMAP_LOCK(bmp); in dbAllocDmapBU()
3273 agno = blkno >> bmp->db_agl2size; in dbAllocDmapBU()
3274 if (agno > bmp->db_maxag) in dbAllocDmapBU()
3275 bmp->db_maxag = agno; in dbAllocDmapBU()
3278 bmp->db_agfree[agno] -= nblocks; in dbAllocDmapBU()
3279 bmp->db_nfree -= nblocks; in dbAllocDmapBU()
3281 BMAP_UNLOCK(bmp); in dbAllocDmapBU()
3291 if ((rc = dbAdjCtl(bmp, blkno, tp->stree[ROOT], 1, 0))) in dbAllocDmapBU()
3292 dbFreeBits(bmp, dp, blkno, nblocks); in dbAllocDmapBU()
3326 struct bmap *bmp = sbi->bmap; in dbExtendFS() local
3343 bmp->db_mapsize = newsize; in dbExtendFS()
3344 bmp->db_maxlevel = BMAPSZTOLEV(bmp->db_mapsize); in dbExtendFS()
3348 oldl2agsize = bmp->db_agl2size; in dbExtendFS()
3350 bmp->db_agl2size = l2agsize; in dbExtendFS()
3351 bmp->db_agsize = 1 << l2agsize; in dbExtendFS()
3354 agno = bmp->db_numag; in dbExtendFS()
3355 bmp->db_numag = newsize >> l2agsize; in dbExtendFS()
3356 bmp->db_numag += ((u32) newsize % (u32) bmp->db_agsize) ? 1 : 0; in dbExtendFS()
3369 ag_rem = bmp->db_agfree[0]; /* save agfree[0] */ in dbExtendFS()
3371 bmp->db_agfree[n] = 0; /* init collection point */ in dbExtendFS()
3376 bmp->db_agfree[n] += bmp->db_agfree[i]; in dbExtendFS()
3379 bmp->db_agfree[0] += ag_rem; /* restore agfree[0] */ in dbExtendFS()
3382 bmp->db_agfree[n] = 0; in dbExtendFS()
3388 bmp->db_maxag = bmp->db_maxag / k; in dbExtendFS()
3504 bmp->db_nfree += n; in dbExtendFS()
3506 bmp->db_agfree[agno] += n; in dbExtendFS()
3535 bmp->db_maxfreebud = *l1leaf; in dbExtendFS()
3559 bmp->db_maxfreebud = *l2leaf; in dbExtendFS()
3589 struct bmap *bmp = JFS_SBI(ipbmap->i_sb)->bmap; in dbFinalizeBmap() local
3604 actags = bmp->db_maxag + 1; in dbFinalizeBmap()
3605 inactags = bmp->db_numag - actags; in dbFinalizeBmap()
3606 ag_rem = bmp->db_mapsize & (bmp->db_agsize - 1); /* ??? */ in dbFinalizeBmap()
3614 ((inactags - 1) << bmp->db_agl2size) + ag_rem in dbFinalizeBmap()
3615 : inactags << bmp->db_agl2size; in dbFinalizeBmap()
3621 actfree = bmp->db_nfree - inactfree; in dbFinalizeBmap()
3628 if (bmp->db_agfree[bmp->db_agpref] < avgfree) { in dbFinalizeBmap()
3629 for (bmp->db_agpref = 0; bmp->db_agpref < actags; in dbFinalizeBmap()
3630 bmp->db_agpref++) { in dbFinalizeBmap()
3631 if (bmp->db_agfree[bmp->db_agpref] >= avgfree) in dbFinalizeBmap()
3634 if (bmp->db_agpref >= bmp->db_numag) { in dbFinalizeBmap()
3647 bmp->db_aglevel = BMAPSZTOLEV(bmp->db_agsize); in dbFinalizeBmap()
3649 bmp->db_agl2size - (L2BPERDMAP + bmp->db_aglevel * L2LPERCTL); in dbFinalizeBmap()
3650 bmp->db_agheight = l2nl >> 1; in dbFinalizeBmap()
3651 bmp->db_agwidth = 1 << (l2nl - (bmp->db_agheight << 1)); in dbFinalizeBmap()
3652 for (i = 5 - bmp->db_agheight, bmp->db_agstart = 0, n = 1; i > 0; in dbFinalizeBmap()
3654 bmp->db_agstart += n; in dbFinalizeBmap()