]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/jffs2/super.c
fuse: verify all ioctl retry iov elements
[karo-tx-linux.git] / fs / jffs2 / super.c
index bc586f204228633ed2d3bcf388991a0ec4b21ff8..61ea41389f90d91d8b3ab6a6a39cd580720f1950 100644 (file)
@@ -90,6 +90,8 @@ static int jffs2_show_options(struct seq_file *s, struct dentry *root)
 
        if (opts->override_compr)
                seq_printf(s, ",compr=%s", jffs2_compr_name(opts->compr));
+       if (opts->rp_size)
+               seq_printf(s, ",rp_size=%u", opts->rp_size / 1024);
 
        return 0;
 }
@@ -154,15 +156,18 @@ static const struct export_operations jffs2_export_ops = {
  * JFFS2 mount options.
  *
  * Opt_override_compr: override default compressor
+ * Opt_rp_size: size of reserved pool in KiB
  * Opt_err: just end of array marker
  */
 enum {
        Opt_override_compr,
+       Opt_rp_size,
        Opt_err,
 };
 
 static const match_table_t tokens = {
        {Opt_override_compr, "compr=%s"},
+       {Opt_rp_size, "rp_size=%u"},
        {Opt_err, NULL},
 };
 
@@ -170,6 +175,7 @@ static int jffs2_parse_options(struct jffs2_sb_info *c, char *data)
 {
        substring_t args[MAX_OPT_ARGS];
        char *p, *name;
+       unsigned int opt;
 
        if (!data)
                return 0;
@@ -207,6 +213,17 @@ static int jffs2_parse_options(struct jffs2_sb_info *c, char *data)
                        kfree(name);
                        c->mount_opts.override_compr = true;
                        break;
+               case Opt_rp_size:
+                       if (match_int(&args[0], &opt))
+                               return -EINVAL;
+                       opt *= 1024;
+                       if (opt > c->mtd->size) {
+                               pr_warn("Too large reserve pool specified, max "
+                                       "is %llu KB\n", c->mtd->size / 1024);
+                               return -EINVAL;
+                       }
+                       c->mount_opts.rp_size = opt;
+                       break;
                default:
                        pr_err("Error: unrecognized mount option '%s' or missing value\n",
                               p);