--- Net2/vm/vm_swap.c 2018/04/24 18:03:57 1.1.1.1 +++ Net2/vm/vm_swap.c 2018/04/24 18:04:47 1.1.1.2 @@ -32,6 +32,7 @@ * * @(#)vm_swap.c 7.18 (Berkeley) 5/6/91 */ +static char rcsid[] = "$Header: /var/lib/cvsd/net2/Net2/vm/vm_swap.c,v 1.1.1.2 2018/04/24 18:04:47 root Exp $"; #include "param.h" #include "systm.h" @@ -42,8 +43,8 @@ #include "dmap.h" /* XXX */ #include "vnode.h" #include "specdev.h" -#include "map.h" #include "file.h" +#include "rlist.h" /* * Indirect driver for multi-controller paging. @@ -245,22 +246,15 @@ swfree(p, index) panic("swfree"); if (blk > dmmax) blk = dmmax; - if (vsbase == 0) { - /* - * First of all chunks... initialize the swapmap - * the second half of the hunk. - */ - rminit(swapmap, (long)(blk/2), (long)(blk/2), - "swap", nswapmap); - } else if (dvbase == 0) { - /* - * Don't use the first cluster of the device - * in case it starts with a label or boot block. - */ - rmfree(swapmap, blk - ctod(CLSIZE), - vsbase + ctod(CLSIZE)); - } else - rmfree(swapmap, blk, vsbase); + /* + * Don't use the first cluster of the device + * in case it starts with a label or boot block. + */ + if (dvbase == 0) + rlist_free(&swapmap, vsbase + ctod(CLSIZE), + vsbase + blk - 1); + else + rlist_free(&swapmap, vsbase, vsbase + blk - 1); } return (0); }