summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c12
-rw-r--r--sys/vm/vnode_pager.c5
2 files changed, 16 insertions, 1 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 307dd0b..97b221e 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -777,6 +777,7 @@ rescan0:
int written;
int swap_pageouts_ok;
struct vnode *vp = NULL;
+ struct mount *mp;
object = m->object;
@@ -853,9 +854,13 @@ rescan0:
if (object->type == OBJT_VNODE) {
vp = object->handle;
+ mp = NULL;
+ if (vp->v_type == VREG)
+ vn_start_write(vp, &mp, V_NOWAIT);
if (VOP_ISLOCKED(vp, NULL) ||
vp->v_data == NULL ||
vget(vp, LK_EXCLUSIVE|LK_NOOBJ, curproc)) {
+ vn_finished_write(mp);
if ((m->queue == PQ_INACTIVE) &&
(m->hold_count == 0) &&
(m->busy == 0) &&
@@ -878,6 +883,7 @@ rescan0:
if (object->flags & OBJ_MIGHTBEDIRTY)
vnodes_skipped++;
vput(vp);
+ vn_finished_write(mp);
continue;
}
@@ -888,6 +894,7 @@ rescan0:
*/
if (m->busy || (m->flags & PG_BUSY)) {
vput(vp);
+ vn_finished_write(mp);
continue;
}
@@ -902,6 +909,7 @@ rescan0:
if (object->flags & OBJ_MIGHTBEDIRTY)
vnodes_skipped++;
vput(vp);
+ vn_finished_write(mp);
continue;
}
}
@@ -913,8 +921,10 @@ rescan0:
* start the cleaning operation.
*/
written = vm_pageout_clean(m);
- if (vp)
+ if (vp) {
vput(vp);
+ vn_finished_write(mp);
+ }
maxlaunder -= written;
}
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 2633426..3dd12ec 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -850,6 +850,7 @@ vnode_pager_putpages(object, m, count, sync, rtvals)
{
int rtval;
struct vnode *vp;
+ struct mount *mp;
int bytes = count * PAGE_SIZE;
/*
@@ -872,11 +873,15 @@ vnode_pager_putpages(object, m, count, sync, rtvals)
*/
vp = object->handle;
+ if (vp->v_type != VREG)
+ mp = NULL;
+ (void)vn_start_write(vp, &mp, V_WAIT);
rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals, 0);
if (rtval == EOPNOTSUPP) {
printf("vnode_pager: *** WARNING *** stale FS putpages\n");
rtval = vnode_pager_generic_putpages( vp, m, bytes, sync, rtvals);
}
+ vn_finished_write(mp);
}
OpenPOWER on IntegriCloud