* calculate the linear (byte) disk address of specified virtual * file address */
| 533 | * file address |
| 534 | */ |
| 535 | static int |
| 536 | vnode_pager_addr(struct vnode *vp, vm_ooffset_t address, daddr_t *rtaddress, |
| 537 | int *run) |
| 538 | { |
| 539 | int bsize; |
| 540 | int err; |
| 541 | daddr_t vblock; |
| 542 | daddr_t voffset; |
| 543 | |
| 544 | if (VN_IS_DOOMED(vp)) |
| 545 | return -1; |
| 546 | |
| 547 | bsize = vp->v_mount->mnt_stat.f_iosize; |
| 548 | vblock = address / bsize; |
| 549 | voffset = address % bsize; |
| 550 | |
| 551 | err = VOP_BMAP(vp, vblock, NULL, rtaddress, run, NULL); |
| 552 | if (err == 0) { |
| 553 | if (*rtaddress != -1) |
| 554 | *rtaddress += voffset / DEV_BSIZE; |
| 555 | if (run) { |
| 556 | *run += 1; |
| 557 | *run *= bsize / PAGE_SIZE; |
| 558 | *run -= voffset / PAGE_SIZE; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | return (err); |
| 563 | } |
| 564 | |
| 565 | /* |
| 566 | * small block filesystem vnode pager input |
no outgoing calls
no test coverage detected