Module Name:    src
Committed By:   hannken
Date:           Mon Aug 23 13:08:18 UTC 2021

Modified Files:
        src/sys/uvm: uvm_swap.c

Log Message:
Return immediately from uvm_swap_shutdown() if there are
no (more) swap devices configured.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.206 src/sys/uvm/uvm_swap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_swap.c
diff -u src/sys/uvm/uvm_swap.c:1.205 src/sys/uvm/uvm_swap.c:1.206
--- src/sys/uvm/uvm_swap.c:1.205	Thu Jun  3 20:18:06 2021
+++ src/sys/uvm/uvm_swap.c	Mon Aug 23 13:08:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_swap.c,v 1.205 2021/06/03 20:18:06 riastradh Exp $	*/
+/*	$NetBSD: uvm_swap.c,v 1.206 2021/08/23 13:08:18 hannken Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.205 2021/06/03 20:18:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.206 2021/08/23 13:08:18 hannken Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_compat_netbsd.h"
@@ -1149,7 +1149,7 @@ uvm_swap_shutdown(struct lwp *l)
 	struct vnode *vp;
 	int error;
 
-	if (!uvm_swap_init_done)
+	if (!uvm_swap_init_done || uvmexp.nswapdev == 0)
 		return;
 	printf("turning off swap...");
 	rw_enter(&swap_syscall_lock, RW_WRITER);

Reply via email to