DBALLOCCK(bmp->db_DBmap, bmp->db_mapsize, blkno, nblocks); 
static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks){	struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);	s64 lblkno, lastblkno, extblkno;	uint rel_block;	struct metapage *mp;	struct dmap *dp;	int rc;	struct inode *ipbmap = sbi->ipbmap;	struct bmap *bmp;	/*	 * We don't want a non-aligned extent to cross a page boundary	 */	if (((rel_block = blkno & (sbi->nbperpage - 1))) &&	    (rel_block + nblocks + addnblocks > sbi->nbperpage))		return -ENOSPC;	/* get the last block of the current allocation */	lastblkno = blkno + nblocks - 1;	/* determine the block number of the block following	 * the existing allocation.	 */	extblkno = lastblkno + 1;	IREAD_LOCK(ipbmap);	/* better be within the file system */	bmp = sbi->bmap;	if (lastblkno < 0 || lastblkno >= bmp->db_mapsize) {		IREAD_UNLOCK(ipbmap);		jfs_error(ip->i_sb,			  "dbExtend: the block is outside the filesystem");		return -EIO;	}	/* we'll attempt to extend the current allocation in place by	 * allocating the additional blocks as the blocks immediately	 * following the current allocation.  we only try to extend the	 * current allocation in place if the number of additional blocks	 * can fit into a dmap, the last block of the current allocation	 * is not the last block of the file system, and the start of the	 * inplace extension is not on an allocation group boundary.	 */	if (addnblocks > BPERDMAP || extblkno >= bmp->db_mapsize ||	    (extblkno & (bmp->db_agsize - 1)) == 0) {		IREAD_UNLOCK(ipbmap);		return -ENOSPC;	}	/* get the buffer for the dmap containing the first block	 * of the extension.	 */	lblkno = BLKTODMAP(extblkno, bmp->db_l2nbperpage);	mp = read_metapage(ipbmap, lblkno, PSIZE, 0);	if (mp == NULL) {		IREAD_UNLOCK(ipbmap);		return -EIO;	}	DBALLOCCK(bmp->db_DBmap, bmp->db_mapsize, blkno, nblocks);	dp = (struct dmap *) mp->data;	/* try to allocate the blocks immediately following the	 * current allocation.	 */	rc = dbAllocNext(bmp, dp, extblkno, (int) addnblocks);	IREAD_UNLOCK(ipbmap);	/* were we successful ? */	if (rc == 0) {		DBALLOC(bmp->db_DBmap, bmp->db_mapsize, extblkno,			addnblocks);		write_metapage(mp);	} else		/* we were not successful */		release_metapage(mp);	return (rc);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b38a3ab3d1bb0dc3288f73903d4dc4672b5cd2d0/jfs_dmap.c/buggy/fs/jfs/jfs_dmap.c