Use swp_pager_isondev() throughout. Submitted by: ota@j.email.ne.jp

Change swp_pager_isondev()'s return type to bool.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D16712
This commit is contained in:
Alan Cox 2018-11-19 17:17:23 +00:00
parent 6fc21012a3
commit 541a117532
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340637

View File

@ -756,7 +756,7 @@ swp_pager_getswapspace(int npages)
return (blk);
}
static int
static bool
swp_pager_isondev(daddr_t blk, struct swdevt *sp)
{
@ -770,7 +770,7 @@ swp_pager_strategy(struct buf *bp)
mtx_lock(&sw_dev_mtx);
TAILQ_FOREACH(sp, &swtailq, sw_list) {
if (bp->b_blkno >= sp->sw_first && bp->b_blkno < sp->sw_end) {
if (swp_pager_isondev(bp->b_blkno, sp)) {
mtx_unlock(&sw_dev_mtx);
if ((sp->sw_flags & SW_UNMAPPED) != 0 &&
unmapped_buf_allowed) {
@ -804,7 +804,7 @@ swp_pager_freeswapspace(daddr_t blk, daddr_t npages)
return;
mtx_lock(&sw_dev_mtx);
TAILQ_FOREACH(sp, &swtailq, sw_list) {
if (blk >= sp->sw_first && blk < sp->sw_end) {
if (swp_pager_isondev(blk, sp)) {
sp->sw_used -= npages;
/*
* If we are attempting to stop swapping on