]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/super.c
i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630
[linux.git] / fs / super.c
index 2d679db9e8c7b64783f34e32e299b8e2d74ed2af..f627b7c53d2b7fefda7546daac7efac40f1a765f 100644 (file)
@@ -1164,9 +1164,11 @@ int vfs_get_super(struct fs_context *fc,
 {
        int (*test)(struct super_block *, struct fs_context *);
        struct super_block *sb;
+       int err;
 
        switch (keying) {
        case vfs_get_single_super:
+       case vfs_get_single_reconf_super:
                test = test_single_super;
                break;
        case vfs_get_keyed_super:
@@ -1184,18 +1186,29 @@ int vfs_get_super(struct fs_context *fc,
                return PTR_ERR(sb);
 
        if (!sb->s_root) {
-               int err = fill_super(sb, fc);
-               if (err) {
-                       deactivate_locked_super(sb);
-                       return err;
-               }
+               err = fill_super(sb, fc);
+               if (err)
+                       goto error;
 
                sb->s_flags |= SB_ACTIVE;
+               fc->root = dget(sb->s_root);
+       } else {
+               fc->root = dget(sb->s_root);
+               if (keying == vfs_get_single_reconf_super) {
+                       err = reconfigure_super(fc);
+                       if (err < 0) {
+                               dput(fc->root);
+                               fc->root = NULL;
+                               goto error;
+                       }
+               }
        }
 
-       BUG_ON(fc->root);
-       fc->root = dget(sb->s_root);
        return 0;
+
+error:
+       deactivate_locked_super(sb);
+       return err;
 }
 EXPORT_SYMBOL(vfs_get_super);
 
@@ -1215,6 +1228,14 @@ int get_tree_single(struct fs_context *fc,
 }
 EXPORT_SYMBOL(get_tree_single);
 
+int get_tree_single_reconf(struct fs_context *fc,
+                 int (*fill_super)(struct super_block *sb,
+                                   struct fs_context *fc))
+{
+       return vfs_get_super(fc, vfs_get_single_reconf_super, fill_super);
+}
+EXPORT_SYMBOL(get_tree_single_reconf);
+
 int get_tree_keyed(struct fs_context *fc,
                  int (*fill_super)(struct super_block *sb,
                                    struct fs_context *fc),
@@ -1534,11 +1555,6 @@ int vfs_get_tree(struct fs_context *fc)
        sb = fc->root->d_sb;
        WARN_ON(!sb->s_bdi);
 
-       if (fc->subtype && !sb->s_subtype) {
-               sb->s_subtype = fc->subtype;
-               fc->subtype = NULL;
-       }
-
        /*
         * Write barrier is for super_cache_count(). We place it before setting
         * SB_BORN as the data dependency between the two functions is the