| 2979 | */ |
| 2980 | |
| 2981 | static void |
| 2982 | swapdev_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 | |
| 3003 | static void |
| 3004 | swapdev_close(struct thread *td, struct swdevt *sp) |
nothing calls this directly
no test coverage detected