diff options
author | dg <dg@FreeBSD.org> | 1995-05-14 03:00:10 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-14 03:00:10 +0000 |
commit | b649d7b9c7fc4e854447610d77a8f589d6d879df (patch) | |
tree | e3f8adb9c567dce966929b13f5ef9bc8016008d6 /sys/nfsclient | |
parent | 8f5311b61712fdd904658b7a56c5832f71bffcab (diff) | |
download | FreeBSD-src-b649d7b9c7fc4e854447610d77a8f589d6d879df.zip FreeBSD-src-b649d7b9c7fc4e854447610d77a8f589d6d879df.tar.gz |
Changed swap partition handling/allocation so that it doesn't
require specific partitions be mentioned in the kernel config
file ("swap on foo" is now obsolete).
From Poul-Henning:
The visible effect is this:
As default, unless
options "NSWAPDEV=23"
is in your config, you will have four swap-devices.
You can swapon(2) any block device you feel like, it doesn't have
to be in the kernel config.
There is a performance/resource win available by getting the NSWAPDEV right
(but only if you have just one swap-device ??), but using that as default
would be too restrictive.
The invisible effect is that:
Swap-handling disappears from the $arch part of the kernel.
It gets a lot simpler (-145 lines) and cleaner.
Reviewed by: John Dyson, David Greenman
Submitted by: Poul-Henning Kamp, with minor changes by me.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 562c953..7e3c696 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.11 1995/03/16 18:15:40 bde Exp $ + * $Id: nfs_vfsops.c,v 1.12 1995/03/16 20:23:46 wollman Exp $ */ #include <sys/param.h> @@ -273,32 +273,15 @@ nfs_mountroot() (void) nfs_mountdiskless(buf, "/swap", 0, &nd->swap_saddr, &nd->swap_args, &vp); - for (i=0;swdevt[i].sw_dev != NODEV;i++) ; - /* * Since the swap file is not the root dir of a file system, * hack it to a regular file. */ vp->v_type = VREG; vp->v_flag = 0; - swapdev_vp = vp; VREF(vp); - swdevt[i].sw_vp = vp; - swdevt[i].sw_nblks = nd->swap_nblks*2; - - if (!swdevt[i].sw_nblks) { - swdevt[i].sw_nblks = 2048; - printf("defaulting to %d kbyte.\n", - swdevt[i].sw_nblks/2); - } else - printf("using %d kbyte.\n",swdevt[i].sw_nblks/2); - } else { - /* - * No NFS swap space was specified, try using local disk - */ - if (bdevvp(swapdev, &swapdev_vp)) - panic("nfs_mountroot: can't setup bdevvp for swap"); - } + swaponvp(p, vp, NODEV, nd->swap_nblks * 2); + } /* * Create the rootfs mount point. |