September 21, 2009 posted by Antti Kantee
This year I mentored Arnaud Ysmal's Summer
of Code project entitled "Generic file system mounting".
This post contains a recap of the goals and presents the
File systems in NetBSD are mounted with the mount(2) system call.
In addition to the file system type and mount target directory, the syscall
takes an opaque container, "void *data". This container is filled
by the mount_fs utility and interpreted by the kernel file system
driver. Typically, it contains at least the device name where the
file system is to be mounted from. Since the layout of the container
varies based on the file system type, a special userspace utility
which knows how to access that structure is currently required for
every different file system. This is a problem especially for things like
which support a large number of file systems and work on a completely
abstract interface. Since these applications need to know
the mount structure layout for each file system, they require file
system specific code for each supported file system and cannot be
considered fully pluggable.
The project's goal was to research eliminating the opaque data
container from mount and instead passing parameters as a text list,
possibly using proplib.
The subgoals were:
- investigating how other operating systems handle file system mounting
- based on the previous subgoal, the specification of a protocol
which can be used for replacing the opaque container argument
- the specification of a vfs probe routine, which allows asking
a file system driver if it supports the given generic mount protocol
- a working test implementation
All of the project subgoals were met. A kernel with a working test
implementation was succesfully booted and run. The source code,
including patches to the NetBSD kernel and fs-utils is available
In the coming months we will continue working on the mount protocol
and backwards compatibility to existing mount utilities before
proposing the change on the NetBSD mailing lists.