Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ufs/ufs_bmap.c
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | ufs_bmap(ap) | ||||
ufs2_daddr_t blkno; | ufs2_daddr_t blkno; | ||||
int error; | int error; | ||||
/* | /* | ||||
* Check for underlying vnode requests and ensure that logical | * Check for underlying vnode requests and ensure that logical | ||||
* to physical mapping is requested. | * to physical mapping is requested. | ||||
*/ | */ | ||||
if (ap->a_bop != NULL) | if (ap->a_bop != NULL) | ||||
*ap->a_bop = &VFSTOUFS(ap->a_vp->v_mount)->um_devvp->v_bufobj; | *ap->a_bop = vp2bo(VFSTOUFS(ap->a_vp->v_mount)->um_devvp); | ||||
if (ap->a_bnp == NULL) | if (ap->a_bnp == NULL) | ||||
return (0); | return (0); | ||||
error = ufs_bmaparray(ap->a_vp, ap->a_bn, &blkno, NULL, | error = ufs_bmaparray(ap->a_vp, ap->a_bn, &blkno, NULL, | ||||
ap->a_runp, ap->a_runb); | ap->a_runp, ap->a_runb); | ||||
*ap->a_bnp = blkno; | *ap->a_bnp = blkno; | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) | ||||
for (bp = NULL, ++ap; --num; ++ap) { | for (bp = NULL, ++ap; --num; ++ap) { | ||||
/* | /* | ||||
* Exit the loop if there is no disk address assigned yet and | * Exit the loop if there is no disk address assigned yet and | ||||
* the indirect block isn't in the cache, or if we were | * the indirect block isn't in the cache, or if we were | ||||
* looking for an indirect block and we've found it. | * looking for an indirect block and we've found it. | ||||
*/ | */ | ||||
metalbn = ap->in_lbn; | metalbn = ap->in_lbn; | ||||
if ((daddr == 0 && !incore(&vp->v_bufobj, metalbn)) || metalbn == bn) | if ((daddr == 0 && !incore(vp2bo(vp), metalbn)) || | ||||
metalbn == bn) | |||||
break; | break; | ||||
/* | /* | ||||
* If we get here, we've either got the block in the cache | * If we get here, we've either got the block in the cache | ||||
* or we have a disk address for it, go fetch it. | * or we have a disk address for it, go fetch it. | ||||
*/ | */ | ||||
if (bp) | if (bp) | ||||
bqrelse(bp); | bqrelse(bp); | ||||
error = readindir(vp, metalbn, daddr, &bp); | error = readindir(vp, metalbn, daddr, &bp); | ||||
▲ Show 20 Lines • Show All 260 Lines • Show Last 20 Lines |