Google Summer of Code Generic file system mounting project


June 21, 2009 posted by Arnaud Ysmal

Generic file system mounting introduction

File systems have their own "proprietary" mount protocol. Those protocols are defined as opaque containers called struct <fs>_args which contain different things from one file system to another. These need to be treated differently, as each addition of a file system implies adding specific code on every program which wants to use it.

The aim of this project is to replace them by a generic protocol, which could be used for every file system. Doing so, it could be possible for instance to mount a device without having to specify the file system type. To do this, I am using a prop_dictionary instead of the struct <fs>_args.

Deliverables

Mandatory (must-have) components:

  • mount_generic command
  • patches for in-tree file systems
  • patch to add a new vfs operation
Optional (would-be-nice) components:
  • up-to-date manpages

Status

A proof of concept has been written. It contains the conversion of some file systems so as to use a properties dictionary, the new vfs_probe function and some applications which use them. It was tested with rump(3) which allows to do the tests without having to rebuild a kernel and to debug as easily as if it were a userland application. I converted fs-utils applications to make them use rump syscalls instead of the ukfs library. Then I wrote a new mounting library which uses the properties library. This library will be used to write the mount_generic program.
The code of these applications, the patch of the file systems and the vfs layer are available here.

Remaining work

  • Asking on tech-kern for comments
  • Adding support for remaining file systems
  • Completing the mount_generic command

How to test it

Building the patched rump :

# cd /usr/src/sys
# patch < ~/genfsmount.patch
# cd rump
# make && make install
Building fs-utils libraries and applications :
# cd fsu_rsprop/lib
# make includes
# cd ..
# make && make install

Examples

Usage

$ fsu_ls -o ro -w ffs.xml ~/ffs.img
Trying ffs: probing success, mount succeed
CVS             Makefile.rump   TODO            include         net
Makefile        README.dirs     fs              librump

$ cat ffs.xml 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>fspec</key>
        <string>/home/stacktic/ffs.img</string>
</dict>
</plist>

$ fsu_cat -f ffs.xml Makefile
Trying ffs: probing success, mount succeed
#       $NetBSD: Makefile,v 1.4 2008/11/17 10:21:44 pooka Exp $
#

SUBDIR= include librump fs net

.include <bsd.subdir.mk>

$ fsu_ls -o ro ~/i386cd.iso 
Trying ffs: probing failed (22)
Trying cd9660: probing success, mount succeed
bin             dev             lib             mnt2            stand           sysinstmsgs.es  targetroot
boot            etc             libexec         netbsd          sysinst         sysinstmsgs.fr  tmp
boot.cfg        i386            mnt             sbin            sysinstmsgs.de  sysinstmsgs.pl  usr

Using specific options

$ fsu_ls ~/msdos.img               
Trying ffs: probing failed (22)
Trying cd9660: probing failed (22)
Trying msdos: probing succeeded, mount succeeded
CVS             Makefile.rump   TODO            include         net
Makefile        README.dirs     fs              librump

$ fsu_ls -s shortname,uid=stacktic,gid=users ~/msdos.img -l
Adding: shortname = true
Adding: uid = 1000
Adding: gid = 100
Trying ffs: probing failed (22)
Trying cd9660: probing failed (22)
Trying msdos: probing succeeded, mount succeeded
total 288
d---------  1 stacktic  users  16384 Jun 12 11:30 cvs
d---------  1 stacktic  users  16384 Jun 12 11:30 fs
d---------  1 stacktic  users  16384 Jun 12 11:30 include
d---------  1 stacktic  users  16384 Jun 12 11:30 librump
----------  1 stacktic  users    118 Jun 12 11:30 makefile
----------  1 stacktic  users   2377 Jun 12 11:30 makefi~1.rum
d---------  1 stacktic  users  16384 Jun 12 11:30 net
----------  1 stacktic  users   1525 Jun 12 11:30 readme~1.dir
----------  1 stacktic  users    530 Jun 12 11:30 todo

Links

[0 comments]

 



Post a Comment:
Comments are closed for this entry.