Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_pageout.c
Show First 20 Lines • Show All 600 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static int | static int | ||||
vm_pageout_clean(vm_page_t m, int *numpagedout) | vm_pageout_clean(vm_page_t m, int *numpagedout) | ||||
{ | { | ||||
struct vnode *vp; | struct vnode *vp; | ||||
struct mount *mp; | struct mount *mp; | ||||
vm_object_t object; | vm_object_t object; | ||||
vm_pindex_t pindex; | vm_pindex_t pindex; | ||||
int error, lockmode; | int error; | ||||
object = m->object; | object = m->object; | ||||
VM_OBJECT_ASSERT_WLOCKED(object); | VM_OBJECT_ASSERT_WLOCKED(object); | ||||
error = 0; | error = 0; | ||||
vp = NULL; | vp = NULL; | ||||
mp = NULL; | mp = NULL; | ||||
/* | /* | ||||
Show All 17 Lines | if (vp->v_type == VREG && | ||||
error = EDEADLK; | error = EDEADLK; | ||||
goto unlock_all; | goto unlock_all; | ||||
} | } | ||||
KASSERT(mp != NULL, | KASSERT(mp != NULL, | ||||
("vp %p with NULL v_mount", vp)); | ("vp %p with NULL v_mount", vp)); | ||||
vm_object_reference_locked(object); | vm_object_reference_locked(object); | ||||
pindex = m->pindex; | pindex = m->pindex; | ||||
VM_OBJECT_WUNLOCK(object); | VM_OBJECT_WUNLOCK(object); | ||||
lockmode = MNT_SHARED_WRITES(vp->v_mount) ? | if (vget(vp, vn_lktype_write(NULL, vp) | LK_TIMELOCK) != 0) { | ||||
LK_SHARED : LK_EXCLUSIVE; | |||||
if (vget(vp, lockmode | LK_TIMELOCK)) { | |||||
vp = NULL; | vp = NULL; | ||||
error = EDEADLK; | error = EDEADLK; | ||||
goto unlock_mp; | goto unlock_mp; | ||||
} | } | ||||
VM_OBJECT_WLOCK(object); | VM_OBJECT_WLOCK(object); | ||||
/* | /* | ||||
* Ensure that the object and vnode were not disassociated | * Ensure that the object and vnode were not disassociated | ||||
▲ Show 20 Lines • Show All 1,755 Lines • Show Last 20 Lines |