Make swapgeneric.c compile and (sort of) work again.

This is really just a token gesture at this point. We can't really turn
on swapping here anymore because (I think) we need to do a namei() lookup
in order to get a vnode which we can pass to swaponvp(). But to do a
namei(), we need a properly initialized proc structure, and we don't
have one. (I was hopping to toss it proc0, but that isn't initialized
until later.) We could conceiveably fabricate a dummy proc structure
to make namei() happy, but that's too much work for too little payoff.

For now, swapgeneric's only remaining saving grace is that it lets
you set the root device with -a.
This commit is contained in:
Bill Paul 1995-10-03 14:49:38 +00:00
parent eca0f5097e
commit b6e1531773
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11147

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
* $Id: swapgeneric.c,v 1.10 1995/05/12 16:11:07 wpaul Exp $
* $Id: swapgeneric.c,v 1.11 1995/08/19 15:59:35 joerg Exp $
*/
#include <sys/param.h>
@ -64,6 +64,7 @@
dev_t rootdev = NODEV;
dev_t dumpdev = NODEV;
#ifdef notused
int nswap;
struct swdevt swdevt[] = {
{ makedev (0xFF, 0x00000001), 0, 0 },
@ -74,6 +75,7 @@ struct swdevt swdevt[] = {
{ NODEV, 0, 0 },
};
int dmmin, dmmax, dmtext;
#endif
#ifdef NFS
extern int (*mountroot) __P((void));
@ -177,11 +179,13 @@ found:
gc->gc_root = makedev(major(gc->gc_root), unit * MAXPARTITIONS);
rootdev = gc->gc_root;
doswap:
#ifdef notused
swdevt[0].sw_dev = dumpdev =
makedev(major(rootdev), minor(rootdev)+1);
/* swap size and dumplo set during autoconfigure */
if (swaponroot)
rootdev = dumpdev;
#endif
}
void gets(cp)