MFC r291379:

Move the comment about resident pages preventing vnode from leaving
active list, into the header comment for vdrop().
This commit is contained in:
kib 2015-12-04 09:09:19 +00:00
parent e6a699bf60
commit fb0b76eb8f

View File

@ -2425,6 +2425,10 @@ vdrop(struct vnode *vp)
* Drop the hold count of the vnode. If this is the last reference to * Drop the hold count of the vnode. If this is the last reference to
* the vnode we place it on the free list unless it has been vgone'd * the vnode we place it on the free list unless it has been vgone'd
* (marked VI_DOOMED) in which case we will free it. * (marked VI_DOOMED) in which case we will free it.
*
* Because the vnode vm object keeps a hold reference on the vnode if
* there is at least one resident non-cached page, the vnode cannot
* leave the active list without the page cleanup done.
*/ */
void void
vdropl(struct vnode *vp) vdropl(struct vnode *vp)
@ -2540,11 +2544,13 @@ vinactive(struct vnode *vp, struct thread *td)
VI_UNLOCK(vp); VI_UNLOCK(vp);
/* /*
* Before moving off the active list, we must be sure that any * Before moving off the active list, we must be sure that any
* modified pages are on the vnode's dirty list since these will * modified pages are converted into the vnode's dirty
* no longer be checked once the vnode is on the inactive list. * buffers, since these will no longer be checked once the
* Because the vnode vm object keeps a hold reference on the vnode * vnode is on the inactive list.
* if there is at least one resident non-cached page, the vnode *
* cannot leave the active list without the page cleanup done. * The write-out of the dirty pages is asynchronous. At the
* point that VOP_INACTIVE() is called, there could still be
* pending I/O and dirty pages in the object.
*/ */
obj = vp->v_object; obj = vp->v_object;
if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) { if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {