Bring in DIRFS: A filesystem for VKERNELS
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Wed, 22 Aug 2012 12:53:18 +0000 (14:53 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Thu, 5 Sep 2013 00:14:38 +0000 (02:14 +0200)
commit509bc517a3efdc2540ce5ca92d2ef4afec4e8b6d
tree88fbaebab150c36042969078b42bc280c28b6a0e
parentf0bb593fb6e9d3ee1cc335b8073b092ac95848fb
Bring in DIRFS: A filesystem for VKERNELS

* 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?
14 files changed:
sbin/Makefile
sbin/mount_dirfs/Makefile [new file with mode: 0644]
sbin/mount_dirfs/mount_dirfs.8 [new file with mode: 0644]
sbin/mount_dirfs/mount_dirfs.c [new file with mode: 0644]
share/man/man5/Makefile
share/man/man5/dirfs.5 [new file with mode: 0644]
sys/platform/vkernel/conf/files
sys/platform/vkernel/conf/options
sys/platform/vkernel64/conf/files
sys/platform/vkernel64/conf/options
sys/vfs/dirfs/dirfs.h [new file with mode: 0644]
sys/vfs/dirfs/dirfs_subr.c [new file with mode: 0644]
sys/vfs/dirfs/dirfs_vfsops.c [new file with mode: 0644]
sys/vfs/dirfs/dirfs_vnops.c [new file with mode: 0644]