diff options
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r-- | Documentation/filesystems/vfs.txt | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index bd55038b56f5..81e5be6e6e35 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -151,7 +151,7 @@ The get_sb() method has the following arguments: | |||
151 | const char *dev_name: the device name we are mounting. | 151 | const char *dev_name: the device name we are mounting. |
152 | 152 | ||
153 | void *data: arbitrary mount options, usually comes as an ASCII | 153 | void *data: arbitrary mount options, usually comes as an ASCII |
154 | string | 154 | string (see "Mount Options" section) |
155 | 155 | ||
156 | struct vfsmount *mnt: a vfs-internal representation of a mount point | 156 | struct vfsmount *mnt: a vfs-internal representation of a mount point |
157 | 157 | ||
@@ -182,7 +182,7 @@ A fill_super() method implementation has the following arguments: | |||
182 | must initialize this properly. | 182 | must initialize this properly. |
183 | 183 | ||
184 | void *data: arbitrary mount options, usually comes as an ASCII | 184 | void *data: arbitrary mount options, usually comes as an ASCII |
185 | string | 185 | string (see "Mount Options" section) |
186 | 186 | ||
187 | int silent: whether or not to be silent on error | 187 | int silent: whether or not to be silent on error |
188 | 188 | ||
@@ -291,7 +291,8 @@ or bottom half). | |||
291 | 291 | ||
292 | umount_begin: called when the VFS is unmounting a filesystem. | 292 | umount_begin: called when the VFS is unmounting a filesystem. |
293 | 293 | ||
294 | show_options: called by the VFS to show mount options for /proc/<pid>/mounts. | 294 | show_options: called by the VFS to show mount options for |
295 | /proc/<pid>/mounts. (see "Mount Options" section) | ||
295 | 296 | ||
296 | quota_read: called by the VFS to read from filesystem quota file. | 297 | quota_read: called by the VFS to read from filesystem quota file. |
297 | 298 | ||
@@ -969,6 +970,49 @@ manipulate dentries: | |||
969 | For further information on dentry locking, please refer to the document | 970 | For further information on dentry locking, please refer to the document |
970 | Documentation/filesystems/dentry-locking.txt. | 971 | Documentation/filesystems/dentry-locking.txt. |
971 | 972 | ||
973 | Mount Options | ||
974 | ============= | ||
975 | |||
976 | Parsing options | ||
977 | --------------- | ||
978 | |||
979 | On mount and remount the filesystem is passed a string containing a | ||
980 | comma separated list of mount options. The options can have either of | ||
981 | these forms: | ||
982 | |||
983 | option | ||
984 | option=value | ||
985 | |||
986 | The <linux/parser.h> header defines an API that helps parse these | ||
987 | options. There are plenty of examples on how to use it in existing | ||
988 | filesystems. | ||
989 | |||
990 | Showing options | ||
991 | --------------- | ||
992 | |||
993 | If a filesystem accepts mount options, it must define show_options() | ||
994 | to show all the currently active options. The rules are: | ||
995 | |||
996 | - options MUST be shown which are not default or their values differ | ||
997 | from the default | ||
998 | |||
999 | - options MAY be shown which are enabled by default or have their | ||
1000 | default value | ||
1001 | |||
1002 | Options used only internally between a mount helper and the kernel | ||
1003 | (such as file descriptors), or which only have an effect during the | ||
1004 | mounting (such as ones controlling the creation of a journal) are exempt | ||
1005 | from the above rules. | ||
1006 | |||
1007 | The underlying reason for the above rules is to make sure, that a | ||
1008 | mount can be accurately replicated (e.g. umounting and mounting again) | ||
1009 | based on the information found in /proc/mounts. | ||
1010 | |||
1011 | A simple method of saving options at mount/remount time and showing | ||
1012 | them is provided with the save_mount_options() and | ||
1013 | generic_show_options() helper functions. Please note, that using | ||
1014 | these may have drawbacks. For more info see header comments for these | ||
1015 | functions in fs/namespace.c. | ||
972 | 1016 | ||
973 | Resources | 1017 | Resources |
974 | ========= | 1018 | ========= |