Before I leave for a week a small update (for Danny :) * Sat 05 Apr 2003 Andrey Borzenkov <[EMAIL PROTECTED]> 1.2.1
- fixed stupid thinko in mediactl methods (the effect was it was impossible to manually eject ro media). It was exposed by recent changes. No changes in supermount itself only in driver code - replace no_tray_lock with tray_lock={never,onwrite,always} with "onwrite" being default. I stil do not quite like resulting code but it will do for now. - simplified subfs_(get|put)_(write|read) interface; merge both read/write in one function; remove subfs_get_atime. To my surprise it resulted on more clean interface in the rest of supermount even if subfs_(get|put)_access does look a bit weird. attached are supermount.patch (just a diff to 1.2.0, apply in fs/supermount with patch -p0), kernel.patch with mediactl fix (apply in kernel source with patch -p1) and updated supermount.txt Sorry for stupid bug -andrey
Supermount README ================= Running supermount ------------------ To run supermount, compile and install a kernel with the supermount patches and select "Y" to the question Supermount removable media support (CONFIG_SUPERMOUNT) [Y/n/?] when you run "make config". You set up a supermount filesystem with the normal mount command, using the syntax: mount -t supermount -o <superfs-options>,--,<subfs-options> none <mpt> where <superfs-options> are the options you want to pass to supermount itself. These are described below. <subfs-options> are the options you want supermount to pass to the dismountable filesystem underneath. <mpt> is the mount point where you want your removable media to be mounted. Notice that you do not directly specify the block device you are going to mount on the mount command line. This is because the supermount filesystem is NOT connected to a block device; rather, supermount is responsible for connecting a separate filesystem to the block device. You specify the sub-filesystem and block device name by providing the <superfs-options> field, where the following options are currently recognised: * fs=<filesystem-type> [default is "auto"] Specify the subfilesystem type. Not every filesystem type has been tested. If you use `auto', it will try the following filesystems in order: "udf" "iso9660" "ext2" "vfat" "msdos" It is also possible to give list of types separated by `:', like fs=ext2:vfat - or - fs=udf:iso9660 * dev=<block-device> [no default, mandatory] Specify the block device on which the subfs is to be mounted. * tray_lock={always,onwrite,never} [default is "onwrite"] Specify when supermount is to prevent media removal. `always' means on every access (it was default in earlier versions), `onwrite' means only for write access and `never' means never :) `onwrite' and `never' are the same for ro media like CD-ROM. It is not clear when `never' is actually useful, it is presented for completeness only. * debug[=<bitmap>] [default is no debug] Enable debugging code in the supermount filesystem, if the debug option was enabled at compile time. By default, debugging code is compiled into the kernel but is disabled until a debug mount option is seen. <bitmap> is the combination of debug flags, following flags are possible: 0x001 - "generic" debug (used by supermount_debug) - default 0x002 - trace dentry.c 0x004 - trace file.c 0x008 - trace filemap.c 0x010 - trace mediactl.c 0x020 - trace namei.c 0x040 - trace subfs.c 0x080 - trace super.c Trace flags turn on tracing of functions in correpsonding files. "Generic" debug flag is tested in supermount_debug; for compatibility, if no flags are specified, this flag is set. * '--' All options after the option string '--' will be passed directly to the subfilesystem when it gets mounted. Errors ------ In addition to "normal" errors during file operations supermount may return following error codes: * No medium found You attempt to access supermounted filesystem when there is no medium inserted * Stale NFS file handle You attempt to use file handle after medium has been changed. * No such device or address (Not really generated by supermount) device specified in dev=<device> option does not exist. Also some drivers return this error instead of "No medium found", one example being floppy driver. * Device or resource busy (Not really generated by supermount) device is already mounted. Supermount prevents double mount even if kernel otherwise would make it possible. * No such file or directory (Not really generated by supermount) file name specified by dev=<device> option does not exist * Operation not permitted You attempt to access subfs that is currently disabled /proc support ------------- If kernel has been compiled with procfs support, supermount will provide /proc interface to read subfs status and to control some aspects of subfs. The following files are created under /proc/fs/supermount: * version (ro) Shows supermount version. * subfs (rw) Reading this file returns list of all subfs status. One line for every subfs is returned; the format is <devname> disabled - or - <devname> unmounted - or - <devname> mounted readcount writecount where <devname> is the string passed in `dev=' parameter during mount. `readcount' is number of current subfs "users" needing ro access; `writecount' is the number of "users" needing rw mode. It is mostly the number of open files, but inode operations also add to these counts. Those operations are normally short-lived to be seen. Writing this file changes subfs status; the following commands are suported: <devname> [disable|enable] [release [force]] `disable' will disable subfs (i.e. any futher attempt to mount is rejected). Subfs must be unmounted; use `disable release' or `disable release force' to unmount and disable at the same time. `enable' will enable disabled subfs, it has no effect if subfs is already enabled. `release' will unmount subfs unless it is busy (opencount > 0). To unmount busy subfs add `force'; the effect is very much as if media change has been detected (with the difference that subfs will be cleanly unmounted). Some basic sanity checks are performed, i.e. it is impossible to specify both `enable' and `disable' or `force' without `release'. Internals/Locking ----------------- THIS SECTION IS PROBABLY INCOMPLETE. CORRECTIONS ARE WELCOME. Supermount itself is using two locks and relies on two more locking rules as implemented by kernel. * supermount_proc_sem Global mutex used to protect list of sbi during access to /proc/fs/supermount/subfs * sbi->sem Per-filesystem mutex that protects subfs state (mounted/unmounted). Any changes to subfs state (mounting, unmouting, adding or removing file, dentry or inode) happen under this mutex. * inode->i_sem (see Documentation/filesystem/Locking) Per-inode mutex used by VFS to serialize inode unlink operation. Supermount relies on the fact that link/unlink for an inode are mutually locked and thus inode->i_nlink is atomic inside of fs method. * BKL Used to protect device usage count. It is changed in open/release and referenced in ioctl all of which run under BKL. Supermount adds mediactl and internally wraps it in BKL as well. $Id: supermount.txt,v 1.11 2003/04/05 17:52:47 bor Exp $
supermount.patch.gz
Description: application/gzip
kernel.patch
Description: Binary data