]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
VFS: Kill off s_options and helpers
authorDavid Howells <dhowells@redhat.com>
Wed, 5 Jul 2017 15:25:53 +0000 (16:25 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 11 Jul 2017 10:09:21 +0000 (06:09 -0400)
Kill off s_options, save/replace_mount_options() and generic_show_options()
as all filesystems now implement ->show_options() for themselves.  This
should make it easier to implement a context-based mount where the mount
options can be passed individually over a file descriptor.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Documentation/filesystems/vfs.txt
fs/efivarfs/super.c
fs/namespace.c
fs/super.c
include/linux/fs.h

index f42b90687d406b73b4a24b2d92c9116540cc8ca1..ee56a7d10da9043bc6ec4da22b68bb6f1810a44e 100644 (file)
@@ -1187,12 +1187,6 @@ 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
 =========
 
index d7a7c53803c1bfd0254d0479851cf259cea29f7c..5b68e4294faa53728272e347fdf6002210fcb632 100644 (file)
@@ -29,7 +29,6 @@ static const struct super_operations efivarfs_ops = {
        .statfs = simple_statfs,
        .drop_inode = generic_delete_inode,
        .evict_inode = efivarfs_evict_inode,
-       .show_options = generic_show_options,
 };
 
 static struct super_block *efivarfs_sb;
index 544ab84642ebde91ec023eb46e7cc237053d6c00..0e1fdb30613368c2aef348350ff744d0ef50c673 100644 (file)
@@ -1237,65 +1237,6 @@ struct vfsmount *mnt_clone_internal(const struct path *path)
        return &p->mnt;
 }
 
-static inline void mangle(struct seq_file *m, const char *s)
-{
-       seq_escape(m, s, " \t\n\\");
-}
-
-/*
- * Simple .show_options callback for filesystems which don't want to
- * implement more complex mount option showing.
- *
- * See also save_mount_options().
- */
-int generic_show_options(struct seq_file *m, struct dentry *root)
-{
-       const char *options;
-
-       rcu_read_lock();
-       options = rcu_dereference(root->d_sb->s_options);
-
-       if (options != NULL && options[0]) {
-               seq_putc(m, ',');
-               mangle(m, options);
-       }
-       rcu_read_unlock();
-
-       return 0;
-}
-EXPORT_SYMBOL(generic_show_options);
-
-/*
- * If filesystem uses generic_show_options(), this function should be
- * called from the fill_super() callback.
- *
- * The .remount_fs callback usually needs to be handled in a special
- * way, to make sure, that previous options are not overwritten if the
- * remount fails.
- *
- * Also note, that if the filesystem's .remount_fs function doesn't
- * reset all options to their default value, but changes only newly
- * given options, then the displayed options will not reflect reality
- * any more.
- */
-void save_mount_options(struct super_block *sb, char *options)
-{
-       BUG_ON(sb->s_options);
-       rcu_assign_pointer(sb->s_options, kstrdup(options, GFP_KERNEL));
-}
-EXPORT_SYMBOL(save_mount_options);
-
-void replace_mount_options(struct super_block *sb, char *options)
-{
-       char *old = sb->s_options;
-       rcu_assign_pointer(sb->s_options, options);
-       if (old) {
-               synchronize_rcu();
-               kfree(old);
-       }
-}
-EXPORT_SYMBOL(replace_mount_options);
-
 #ifdef CONFIG_PROC_FS
 /* iterator; we want it to have access to namespace_sem, thus here... */
 static void *m_start(struct seq_file *m, loff_t *pos)
index dfb56a9665d85c1b3d960e76fc6c95a14c76fe3e..6bc3352adcf39fc5ed6cad77b5df5c9d7db3f9cc 100644 (file)
@@ -168,7 +168,6 @@ static void destroy_super(struct super_block *s)
        WARN_ON(!list_empty(&s->s_mounts));
        put_user_ns(s->s_user_ns);
        kfree(s->s_subtype);
-       kfree(s->s_options);
        call_rcu(&s->rcu, destroy_super_rcu);
 }
 
index bc0c054894b9e10b983cd56e658d541c778f3993..e265b2ea72c6308fb3f30408e578733f5bc3aa63 100644 (file)
@@ -1351,11 +1351,6 @@ struct super_block {
         */
        char *s_subtype;
 
-       /*
-        * Saved mount options for lazy filesystems using
-        * generic_show_options()
-        */
-       char __rcu *s_options;
        const struct dentry_operations *s_d_op; /* default d_op for dentries */
 
        /*
@@ -3033,10 +3028,6 @@ extern void setattr_copy(struct inode *inode, const struct iattr *attr);
 
 extern int file_update_time(struct file *file);
 
-extern int generic_show_options(struct seq_file *m, struct dentry *root);
-extern void save_mount_options(struct super_block *sb, char *options);
-extern void replace_mount_options(struct super_block *sb, char *options);
-
 static inline bool io_is_direct(struct file *filp)
 {
        return (filp->f_flags & O_DIRECT) || IS_DAX(filp->f_mapping->host);