From b3b304a23a8f7ae4c40c7b512ee45afae0010a70 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 8 Feb 2008 04:21:35 -0800 Subject: mount options: add generic_show_options() Add a new s_options field to struct super_block. Filesystems can save mount options passed to them in mount or remount. It is automatically freed when the superblock is destroyed. A new helper function, generic_show_options() is introduced, which uses this field to display the mount options in /proc/mounts. Another helper function, save_mount_options() may be used by filesystems to save the options in the super block. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux/fs.h') diff --git a/include/linux/fs.h b/include/linux/fs.h index 3db22fc2249a..cb3a9001f3b9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1038,6 +1038,12 @@ struct super_block { * in /proc/mounts will be "type.subtype" */ char *s_subtype; + + /* + * Saved mount options for lazy filesystems using + * generic_show_options() + */ + char *s_options; }; extern struct timespec current_fs_time(struct super_block *sb); @@ -1970,6 +1976,9 @@ extern int __must_check inode_setattr(struct inode *, struct iattr *); extern void file_update_time(struct file *file); +extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt); +extern void save_mount_options(struct super_block *sb, char *options); + static inline ino_t parent_ino(struct dentry *dentry) { ino_t res; -- cgit v1.2.3