 DBALLOC(bmp->db_DBmap, bmp->db_mapsize, blkno, nb); 
int dbAllocBottomUp(struct inode *ip, s64 blkno, s64 nblocks){	struct metapage *mp;	struct dmap *dp;	int nb, rc;	s64 lblkno, rem;	struct inode *ipbmap = JFS_SBI(ip->i_sb)->ipbmap;	struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap;	IREAD_LOCK(ipbmap);	/* block to be allocated better be within the mapsize. */	ASSERT(nblocks <= bmp->db_mapsize - blkno);	/*	 * allocate the blocks a dmap at a time.	 */	mp = NULL;	for (rem = nblocks; rem > 0; rem -= nb, blkno += nb) {		/* release previous dmap if any */		if (mp) {			write_metapage(mp);		}		/* get the buffer for the current dmap. */		lblkno = BLKTODMAP(blkno, bmp->db_l2nbperpage);		mp = read_metapage(ipbmap, lblkno, PSIZE, 0);		if (mp == NULL) {			IREAD_UNLOCK(ipbmap);			return -EIO;		}		dp = (struct dmap *) mp->data;		/* determine the number of blocks to be allocated from		 * this dmap.		 */		nb = min(rem, BPERDMAP - (blkno & (BPERDMAP - 1)));		DBFREECK(bmp->db_DBmap, bmp->db_mapsize, blkno, nb);		/* allocate the blocks. */		if ((rc = dbAllocDmapBU(bmp, dp, blkno, nb))) {			release_metapage(mp);			IREAD_UNLOCK(ipbmap);			return (rc);		}		DBALLOC(bmp->db_DBmap, bmp->db_mapsize, blkno, nb);	}	/* write the last buffer. */	write_metapage(mp);	IREAD_UNLOCK(ipbmap);	return (0);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b38a3ab3d1bb0dc3288f73903d4dc4672b5cd2d0/jfs_dmap.c/buggy/fs/jfs/jfs_dmap.c