Bring in DIRFS: A filesystem for VKERNELS

Operating Systems / DragonFlyBSD - Antonio Huete Jimenez [quantumachine.net] - 4 September 2013 19:14 UTC

- What is DIRFS? dirfs is a pseudo-filesystem specific for vkernel(7) which allows mounting host's directories into the vkernel. It runs directly in the vkernel's VFS code, as any other regular filesystem, but it does syscalls (vkernels are userland programs) to retrieve or post the information needed on every operation requested.

Needless to say that the operations that you can perform in the host directories/files depend on the permissions the user that runs the vkernel. For example, you will not be able to 'chflags schg' if you run the vkernel with a regular user and not with root.

- How does it work? It basically works like any other filesystem. It has its own mount_dirfs command that will be called by the system's mount(8) command when needed.

vkernel64 # mount -t dirfs /usr/src2 /mnt
vkernel64 # df -h /mnt Filesystem Size Used Avail Capacity Mounted on dirfs@/usr/src2 47G 36G 12G 75% /mnt

Umounting is a normal operation too:

vkernel64 # mount | fgrep dirfs dirfs@/usr/src2 on /mnt (dirfs)
vkernel64 # umount /mnt

- What's the current status Currently it is in a *experimental* status, with (probably) many bugs and some parts missing.

TODO
- Make dirfs mpsafe.
- Fix problems with multiple mount points.
- Implement VOP_NLINK so that hardlinks are possible.
- Add missing kqueue(2) support.
- dirfs root so that a vkernel can be booted from it.
- Locking mechanisms for opened fds between host <-> vkernel.- Make sure dirfs is properly restored after vkernel checkpointing (upcoming GSoC project).
- Bug hunting & bug fixing.- Any ideas?

509bc51 Bring in DIRFS: A filesystem for VKERNELS
sbin/Makefile | 1 +
sbin/mount_dirfs/Makefile | 10 +
sbin/mount_dirfs/mount_dirfs.8 | 66 ++
sbin/mount_dirfs/mount_dirfs.c | 159 ++++
share/man/man5/Makefile | 1 +
share/man/man5/dirfs.5 | 103 +++
sys/platform/vkernel/conf/files | 3 +
sys/platform/vkernel/conf/options | 6 +
sys/platform/vkernel64/conf/files | 3 +
sys/platform/vkernel64/conf/options | 6 +
sys/vfs/dirfs/dirfs.h | 266 +++++++
sys/vfs/dirfs/dirfs_subr.c | 891 +++++++++++++++++++++
sys/vfs/dirfs/dirfs_vfsops.c | 322 ++++++++
sys/vfs/dirfs/dirfs_vnops.c | 1500 +++++++++++++++++++++++++++++++++++
14 files changed, 3337 insertions(+)

Upstream: gitweb.dragonflybsd.org


  • Share