- Synchronize updates to nswapdev using sw_dev_mtx.
This commit is contained in:
parent
65b8a8fed1
commit
0676a140b2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121649
@ -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 @@ swapoff(struct thread *td, struct swapoff_args *uap)
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user