Link Here
|
436 |
static void |
477 |
static void |
437 |
swp_sizecheck(void) |
478 |
swp_sizecheck(void) |
438 |
{ |
479 |
{ |
439 |
|
|
|
440 |
if (swap_pager_avail < nswap_lowat) { |
480 |
if (swap_pager_avail < nswap_lowat) { |
441 |
if (swap_pager_almost_full == 0) { |
481 |
if (swap_pager_almost_full == 0) { |
442 |
printf("swap_pager: out of swap space\n"); |
482 |
printf("swap_pager: out of swap space\n"); |
Link Here
|
725 |
return (blk); |
810 |
return (blk); |
726 |
} |
811 |
} |
727 |
|
812 |
|
728 |
static int |
813 |
static inline int |
729 |
swp_pager_isondev(daddr_t blk, struct swdevt *sp) |
814 |
swp_pager_isondev(daddr_t blk, struct swdevt *sp) |
730 |
{ |
815 |
{ |
731 |
|
|
|
732 |
return (blk >= sp->sw_first && blk < sp->sw_end); |
816 |
return (blk >= sp->sw_first && blk < sp->sw_end); |
733 |
} |
817 |
} |
734 |
|
818 |
|
Link Here
|
739 |
|
823 |
|
740 |
mtx_lock(&sw_dev_mtx); |
824 |
mtx_lock(&sw_dev_mtx); |
741 |
TAILQ_FOREACH(sp, &swtailq, sw_list) { |
825 |
TAILQ_FOREACH(sp, &swtailq, sw_list) { |
742 |
if (bp->b_blkno >= sp->sw_first && bp->b_blkno < sp->sw_end) { |
826 |
if (swp_pager_isondev (bp->b_blkno, sp)) { |
743 |
mtx_unlock(&sw_dev_mtx); |
827 |
mtx_unlock(&sw_dev_mtx); |
744 |
if ((sp->sw_flags & SW_UNMAPPED) != 0 && |
828 |
if ((sp->sw_flags & SW_UNMAPPED) != 0 && |
745 |
unmapped_buf_allowed) { |
829 |
unmapped_buf_allowed) { |
Link Here
|
771 |
|
855 |
|
772 |
mtx_lock(&sw_dev_mtx); |
856 |
mtx_lock(&sw_dev_mtx); |
773 |
TAILQ_FOREACH(sp, &swtailq, sw_list) { |
857 |
TAILQ_FOREACH(sp, &swtailq, sw_list) { |
774 |
if (blk >= sp->sw_first && blk < sp->sw_end) { |
858 |
if (swp_pager_isondev (blk, sp)) { |
775 |
sp->sw_used -= npages; |
859 |
sp->sw_used -= npages; |
776 |
/* |
860 |
/* |
777 |
* If we are attempting to stop swapping on |
861 |
* If we are attempting to stop swapping on |