Subject: Re: how to change swapctl() interface.
To: Todd Vierling <tv@NetBSD.ORG>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 05/26/1998 13:14:08
On Tue, 26 May 1998 12:30:47 -0400 (EDT) 
 Todd Vierling <tv@NetBSD.ORG> wrote:

 > On Tue, 26 May 1998, matthew green wrote:
 > 
 > : i forgot to meantion:  this breaks backwards compatility for
 > : binaries,
 > 
 > Then it's broken.  Create a __swapctl14().  "I have to be able to boot a 1.3
 > binary set on 1.4, so I have to be able to have my swap added...."

No!

We don't need to do that.

The beauty of swapctl(2) is that is has opaque arguments.  Do this:

#define	OSWAP_STATS	4

struct oswapent {
	dev_t	se_dev;
	int	se_flags;
	int	se_nblks;
	int	se_inuse;
	int	se_priority;
};

...and support filling in the old one if COMPAT_13 is enabled.  This makes
old binaries work.

And do:

#define	SWAP_STATS	6

struct swapent {
	char	se_path[<whatever>];
	dev_t	se_dev;
	int	se_flags;
	int	se_nblks;
	int	se_inuse;
	int	se_priority;
};

Always fill in the path name, so that no translation of dev_t -> path
is necessary by swapctl(8).  If se_dev is NODEV, then the device is
a file, else it is a device.  Sound reasonable?

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 428 6939