Subject: Re: swapfs filesystem design (and mount/umount question)
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 03/20/2000 15:39:54
Darren Reed wrote:

> In some email I received from Simon Burge, sie wrote:
> [...]
> > I've just now got a basic empty filesystem framework working (ie, no vops
> > supported except for mount, umount and statfs, and mount doesn't do
> > anything like creating a filesystem).  At the moment I can't unmount the
> > filesystem:
> > 
> > 	wincen:vfs/miscfs/swapfs 1# modload obj.i386/swapfs.o 
> > 	Module loaded as ID 0
> > 	wincen:vfs/miscfs/swapfs 2# mount_swapfs -s 131072 swapfs /mnt
> > 	wincen:vfs/miscfs/swapfs 3# df -i
> > 	Filesystem  1K-blocks  Used  Avail Capacity iused   ifree  %iused  Mounted on
> > 	...
> > 	swapfs          65404     0  65404     0%       0  523232     0%   /mnt
> [...]
> 
> What does it look like if you do:
> mkdir /mnt2
> mount_swapfs -s 131072 swapfs /mnt
> mount_swapfs -s 131072 swapfs /mnt2
> df -it swapfs

Not good :-(

	wincen:~ 1# modload /NetBSD/src/sys/lkm/vfs/miscfs/swapfs/obj.i386/swapfs.o 
	Module loaded as ID 0
	wincen:~ 2# mount_swapfs -s 131072 swapfs /mnt
	wincen:~ 3# mount_swapfs -s 131072 swapfs /mnt2
	wincen:~ 4# df | tail -2
	swapfs                             65404        0    65404     0%    /mnt
	swapfs                             65404        0    65404     0%    /mnt2
	wincen:~ 5# df -it swapfs
	uvm_fault(0xc9bc916c, 0x0, 0, 1) -> 1
	kernel: page fault trap, code=0
	Stopped in df at        sys_statfs+0x4b:        movl    0x8(%ebx),%eax
	db>

I'm beginning to wonder if I need to at least implement swapfs_lookup()
and a few others :)

Simon.