summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-10-29 07:51:41 +0000
committeralc <alc@FreeBSD.org>2003-10-29 07:51:41 +0000
commite2738554471e8039dee411ed3376af7306301818 (patch)
treeba980ac8d2e4590b9975a73e9af80dcccc4febb6
parentfff0d17e397751ee89a42f582193923a1d8331c2 (diff)
downloadFreeBSD-src-e2738554471e8039dee411ed3376af7306301818.zip
FreeBSD-src-e2738554471e8039dee411ed3376af7306301818.tar.gz
- Synchronize updates to nswapdev using sw_dev_mtx.
-rw-r--r--sys/vm/swap_pager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index a7edae2..ea697ca 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2173,8 +2173,8 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strateg
sp->sw_first = dvbase;
sp->sw_end = dvbase + nblks;
TAILQ_INSERT_TAIL(&swtailq, sp, sw_list);
- mtx_unlock(&sw_dev_mtx);
nswapdev++;
+ mtx_unlock(&sw_dev_mtx);
swap_pager_avail += nblks;
swap_pager_full = 0;
}
@@ -2277,10 +2277,10 @@ found:
sp->sw_id = NULL;
mtx_lock(&sw_dev_mtx);
TAILQ_REMOVE(&swtailq, sp, sw_list);
+ nswapdev--;
mtx_unlock(&sw_dev_mtx);
if (swdevhd == sp)
swdevhd = NULL;
- nswapdev--;
blist_destroy(sp->sw_blist);
free(sp, M_VMPGDATA);
OpenPOWER on IntegriCloud