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

Function swapdev_strategy

freebsd/vm/swap_pager.c:2981–3001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2979 */
2980
2981static void
2982swapdev_strategy(struct buf *bp, struct swdevt *sp)
2983{
2984 struct vnode *vp2;
2985
2986 bp->b_blkno = ctodb(bp->b_blkno - sp->sw_first);
2987
2988 vp2 = sp->sw_id;
2989 vhold(vp2);
2990 if (bp->b_iocmd == BIO_WRITE) {
2991 if (bp->b_bufobj)
2992 bufobj_wdrop(bp->b_bufobj);
2993 bufobj_wref(&vp2->v_bufobj);
2994 }
2995 if (bp->b_bufobj != &vp2->v_bufobj)
2996 bp->b_bufobj = &vp2->v_bufobj;
2997 bp->b_vp = vp2;
2998 bp->b_iooffset = dbtob(bp->b_blkno);
2999 bstrategy(bp);
3000 return;
3001}
3002
3003static void
3004swapdev_close(struct thread *td, struct swdevt *sp)

Callers

nothing calls this directly

Calls 4

vholdFunction · 0.85
bufobj_wdropFunction · 0.85
bufobj_wrefFunction · 0.85
bstrategyFunction · 0.85

Tested by

no test coverage detected