FreeBSD/sys/fs/ext2fs/ext2_vnops.c
/*
 * Calculate the logical to physical mapping if not done already,
 * then call the device strategy routine.
 *
 * In order to be able to swap to a file, the ext2_bmaparray() operation may not
 * deadlock on memory.  See ext2_bmap() for details.
 */
Calculate the logical to physical mapping if not done already,
then call the device strategy routine.

In order to be able to swap to a file, the ext2_bmaparray() operation may not
deadlock on memory.  See ext2_bmap() for details.
Calculate the logical to physical mapping if not done already then call the device strategy routine . In order to be able to swap to a file the ext2_bmaparray () operation may not deadlock on memory . See ext2_bmap () for details .
static int
ext2_strategy(struct vop_strategy_args *ap)
{
	struct buf *bp = ap->a_bp;
	struct vnode *vp = ap->a_vp;
	struct bufobj *bo;
	daddr_t blkno;
	int error;
	if (vp->v_type == VBLK || vp->v_type == VCHR)
		panic("ext2_strategy: spec");
	if (bp->b_blkno == bp->b_lblkno) {
		error = ext2_bmaparray(vp, bp->b_lblkno, &blkno, NULL, NULL);
		bp->b_blkno = blkno;
		if (error) {
			bp->b_error = error;
			bp->b_ioflags |= BIO_ERROR;
			bufdone(bp);
			return (0);
		}
		if ((long)bp->b_blkno == -1)
			vfs_bio_clrbuf(bp);
	}
	if ((long)bp->b_blkno == -1) {
		bufdone(bp);
		return (0);
	}
	bp->b_iooffset = dbtob(bp->b_blkno);
	bo = VFSTOEXT2(vp->v_mount)->um_bo;
	BO_STRATEGY(bo, bp);
	return (0);
}
static int ext2_strategy ( struct vop_strategy_args * ap ) { struct buf * bp = ap -> a_bp ; struct vnode * vp = ap -> a_vp ; struct bufobj * bo ; daddr_t blkno ; int error ; if ( vp -> v_type == VBLK || vp -> v_type == VCHR ) panic ( " " ) ; if ( bp -> b_blkno == bp -> b_lblkno ) { error = ext2_bmaparray ( vp , bp -> b_lblkno , & blkno , NULL , NULL ) ; bp -> b_blkno = blkno ; if ( error ) { bp -> b_error = error ; bp -> b_ioflags |= BIO_ERROR ; bufdone ( bp ) ; return ( 0 ) ; } if ( ( long ) bp -> b_blkno == -1 ) vfs_bio_clrbuf ( bp ) ; } if ( ( long ) bp -> b_blkno == -1 ) { bufdone ( bp ) ; return ( 0 ) ; } bp -> b_iooffset = dbtob ( bp -> b_blkno ) ; bo = VFSTOEXT2 ( vp -> v_mount ) -> um_bo ; BO_STRATEGY ( bo , bp ) ; return ( 0 ) ; }
Calculate the logical to physical mapping if not done already,
 then call the device strategy routine.
Calculate the logical to physical mapping if not done already then call the device strategy routine .