* Call VOP_INACTIVE on the vnode and manage the DOINGINACT and OWEINACT * flags. DOINGINACT prevents us from recursing in calls to vinactive. */
| 3617 | * flags. DOINGINACT prevents us from recursing in calls to vinactive. |
| 3618 | */ |
| 3619 | static int |
| 3620 | vinactivef(struct vnode *vp) |
| 3621 | { |
| 3622 | struct vm_object *obj; |
| 3623 | int error; |
| 3624 | |
| 3625 | ASSERT_VOP_ELOCKED(vp, "vinactive"); |
| 3626 | ASSERT_VI_LOCKED(vp, "vinactive"); |
| 3627 | VNASSERT((vp->v_iflag & VI_DOINGINACT) == 0, vp, |
| 3628 | ("vinactive: recursed on VI_DOINGINACT")); |
| 3629 | CTR2(KTR_VFS, "%s: vp %p", __func__, vp); |
| 3630 | vp->v_iflag |= VI_DOINGINACT; |
| 3631 | vp->v_iflag &= ~VI_OWEINACT; |
| 3632 | VI_UNLOCK(vp); |
| 3633 | /* |
| 3634 | * Before moving off the active list, we must be sure that any |
| 3635 | * modified pages are converted into the vnode's dirty |
| 3636 | * buffers, since these will no longer be checked once the |
| 3637 | * vnode is on the inactive list. |
| 3638 | * |
| 3639 | * The write-out of the dirty pages is asynchronous. At the |
| 3640 | * point that VOP_INACTIVE() is called, there could still be |
| 3641 | * pending I/O and dirty pages in the object. |
| 3642 | */ |
| 3643 | if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 && |
| 3644 | vm_object_mightbedirty(obj)) { |
| 3645 | VM_OBJECT_WLOCK(obj); |
| 3646 | vm_object_page_clean(obj, 0, 0, 0); |
| 3647 | VM_OBJECT_WUNLOCK(obj); |
| 3648 | } |
| 3649 | error = VOP_INACTIVE(vp); |
| 3650 | VI_LOCK(vp); |
| 3651 | VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, |
| 3652 | ("vinactive: lost VI_DOINGINACT")); |
| 3653 | vp->v_iflag &= ~VI_DOINGINACT; |
| 3654 | return (error); |
| 3655 | } |
| 3656 | |
| 3657 | int |
| 3658 | vinactive(struct vnode *vp) |
no test coverage detected