From 110e2f0690a6df0109b629840d5efaf2f839f422 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 8 Feb 2008 04:21:34 -0800 Subject: [PATCH] --- yaml --- r: 84783 b: refs/heads/master c: f84e3f521e1449300e0fdc314b7b43b418a66dc3 h: refs/heads/master i: 84781: cfdb91288ef8ec0bd5fa504e847e0da65487973c 84779: fa086303eda57966162b4944e82ea5c358cf01be 84775: c99aabc7971b8a7dc314809fea76ab6df3024e15 84767: 7c37f7515cfd111e433cbd6923fba3e09cbb6a85 v: v3 --- [refs] | 2 +- trunk/Documentation/filesystems/vfs.txt | 50 +++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 2e5dc17d7811..0d03ba56e1b9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e542059884bb6d651d7ffc64eacedbab2b64078c +refs/heads/master: f84e3f521e1449300e0fdc314b7b43b418a66dc3 diff --git a/trunk/Documentation/filesystems/vfs.txt b/trunk/Documentation/filesystems/vfs.txt index bd55038b56f5..81e5be6e6e35 100644 --- a/trunk/Documentation/filesystems/vfs.txt +++ b/trunk/Documentation/filesystems/vfs.txt @@ -151,7 +151,7 @@ The get_sb() method has the following arguments: const char *dev_name: the device name we are mounting. void *data: arbitrary mount options, usually comes as an ASCII - string + string (see "Mount Options" section) struct vfsmount *mnt: a vfs-internal representation of a mount point @@ -182,7 +182,7 @@ A fill_super() method implementation has the following arguments: must initialize this properly. void *data: arbitrary mount options, usually comes as an ASCII - string + string (see "Mount Options" section) int silent: whether or not to be silent on error @@ -291,7 +291,8 @@ or bottom half). umount_begin: called when the VFS is unmounting a filesystem. - show_options: called by the VFS to show mount options for /proc//mounts. + show_options: called by the VFS to show mount options for + /proc//mounts. (see "Mount Options" section) quota_read: called by the VFS to read from filesystem quota file. @@ -969,6 +970,49 @@ manipulate dentries: For further information on dentry locking, please refer to the document Documentation/filesystems/dentry-locking.txt. +Mount Options +============= + +Parsing options +--------------- + +On mount and remount the filesystem is passed a string containing a +comma separated list of mount options. The options can have either of +these forms: + + option + option=value + +The header defines an API that helps parse these +options. There are plenty of examples on how to use it in existing +filesystems. + +Showing options +--------------- + +If a filesystem accepts mount options, it must define show_options() +to show all the currently active options. The rules are: + + - options MUST be shown which are not default or their values differ + from the default + + - options MAY be shown which are enabled by default or have their + default value + +Options used only internally between a mount helper and the kernel +(such as file descriptors), or which only have an effect during the +mounting (such as ones controlling the creation of a journal) are exempt +from the above rules. + +The underlying reason for the above rules is to make sure, that a +mount can be accurately replicated (e.g. umounting and mounting again) +based on the information found in /proc/mounts. + +A simple method of saving options at mount/remount time and showing +them is provided with the save_mount_options() and +generic_show_options() helper functions. Please note, that using +these may have drawbacks. For more info see header comments for these +functions in fs/namespace.c. Resources =========