Subject: how to change swapctl() interface.
To: None <tech-kern@NetBSD.ORG>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 05/26/1998 20:17:30
hi folks.


the swap code does not currently store the pathname of the device or
file being swapped on in the kernel for later reference.  in the old
days, when we only swapped to devices, it was OK because we could use
devname(3) to find out the pathname.  now that we swap to files, we
do not have a way to find out afterwards, _what_ a particular swap
file is named in the filesystem.  unless someone knows how to find
this out (reverse iname?), i propose adding a pathname element to the
swapent stucture.

the very first incarnations of the vm_swap.c i wrote contained support
for something like this, but i later removed for reasons now forgotten.

there are two ways of doing this.  either add a fixed size char array
or add a char * to the swapent structure.  the first has the disadvantage
of wasting a lot of space per swap device (to be correct, you need to
have 1024 bytes of space for this pathname), while the second has the
disadvantage of being an API lose.

what i've done in my kernel is use a smaller fixed sized array (104
bytes i chose, stealing the idea from <sys/un.h>).

104 bytes is a long path name, and probably never will be exceeded in
normal or abnormal circumstances.


the changes to implement this are 2 lines to each of
{u,}vm/{u,}vm_swap.c and 1 to vm/vm_swap.h, and simplification in
swapctl.c.


comments?


.mrg.