FreeBSD/sys/fs/ext2fs/ext2_bmap.c
/*
 * Bmap converts the logical block number of a file to its physical block
 * number on the disk. The conversion is done by using the logical block
 * number to index into the array of block pointers described by the dinode.
 */
Bmap converts the logical block number of a file to its physical block
number on the disk. The conversion is done by using the logical block
number to index into the array of block pointers described by the dinode.
Bmap converts the logical block number of a file to its physical block number on the disk . The conversion is done by using the logical block number to index into the array of block pointers described by the dinode .
int
ext2_bmap(struct vop_bmap_args *ap)
{
	daddr_t blkno;
	int error;
	if (ap->a_bop != NULL)
		*ap->a_bop = &VTOI(ap->a_vp)->i_devvp->v_bufobj;
	if (ap->a_bnp == NULL)
		return (0);
	if (VTOI(ap->a_vp)->i_flag & IN_E4EXTENTS)
		error = ext4_bmapext(ap->a_vp, ap->a_bn, &blkno,
		    ap->a_runp, ap->a_runb);
	else
		error = ext2_bmaparray(ap->a_vp, ap->a_bn, &blkno,
		    ap->a_runp, ap->a_runb);
	*ap->a_bnp = blkno;
	return (error);
}
int ext2_bmap ( struct vop_bmap_args * ap ) { daddr_t blkno ; int error ; if ( ap -> a_bop != NULL ) * ap -> a_bop = & VTOI ( ap -> a_vp ) -> i_devvp -> v_bufobj ; if ( ap -> a_bnp == NULL ) return ( 0 ) ; if ( VTOI ( ap -> a_vp ) -> i_flag & IN_E4EXTENTS ) error = ext4_bmapext ( ap -> a_vp , ap -> a_bn , & blkno , ap -> a_runp , ap -> a_runb ) ; else error = ext2_bmaparray ( ap -> a_vp , ap -> a_bn , & blkno , ap -> a_runp , ap -> a_runb ) ; * ap -> a_bnp = blkno ; return ( error ) ; }
Bmap converts the logical block number of a file to its physical block
 number on the disk.
Bmap converts the logical block number of a file to its physical block number on the disk .
/*
	 * Check for underlying vnode requests and ensure that logical
	 * to physical mapping is requested.
	 */