git: Bring in DIRFS: A filesystem for VKERNELS
Antonio Huete Jimenez
tuxillo at crater.dragonflybsd.org
Wed Sep 4 17:16:26 PDT 2013
commit 509bc517a3efdc2540ce5ca92d2ef4afec4e8b6d
Author: Antonio Huete Jimenez <tuxillo at quantumachine.net>
Date: Wed Aug 22 14:53:18 2012 +0200
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?
Summary of changes:
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(+)
create mode 100644 sbin/mount_dirfs/Makefile
create mode 100644 sbin/mount_dirfs/mount_dirfs.8
create mode 100644 sbin/mount_dirfs/mount_dirfs.c
create mode 100644 share/man/man5/dirfs.5
create mode 100644 sys/vfs/dirfs/dirfs.h
create mode 100644 sys/vfs/dirfs/dirfs_subr.c
create mode 100644 sys/vfs/dirfs/dirfs_vfsops.c
create mode 100644 sys/vfs/dirfs/dirfs_vnops.c
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/509bc517a3efdc2540ce5ca92d2ef4afec4e8b6d
--
DragonFly BSD source repository
More information about the Commits
mailing list