MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vnode_pager_addr

Function vnode_pager_addr

freebsd/vm/vnode_pager.c:535–563  ·  view source on GitHub ↗

* calculate the linear (byte) disk address of specified virtual * file address */

Source from the content-addressed store, hash-verified

533 * file address
534 */
535static int
536vnode_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

Callers 1

vnode_pager_input_smlfsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected