summaryrefslogtreecommitdiff
path: root/fs/jffs2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/super.c')
-rw-r--r--fs/jffs2/super.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 40f6e6385fd..e7e97445411 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -82,6 +82,14 @@ static const char *jffs2_compr_name(unsigned int compr)
switch (compr) {
case JFFS2_COMPR_MODE_NONE:
return "none";
+#ifdef CONFIG_JFFS2_LZO
+ case JFFS2_COMPR_MODE_FORCELZO:
+ return "lzo";
+#endif
+#ifdef CONFIG_JFFS2_ZLIB
+ case JFFS2_COMPR_MODE_FORCEZLIB:
+ return "zlib";
+#endif
default:
/* should never happen; programmer error */
WARN_ON(1);
@@ -195,11 +203,25 @@ static int jffs2_parse_options(struct jffs2_sb_info *c, char *data)
if (!name)
return -ENOMEM;
- if (!strcmp(name, "none")) {
+ if (!strcmp(name, "none"))
c->mount_opts.compr = JFFS2_COMPR_MODE_NONE;
- c->mount_opts.override_compr = true;
+#ifdef CONFIG_JFFS2_LZO
+ else if (!strcmp(name, "lzo"))
+ c->mount_opts.compr = JFFS2_COMPR_MODE_FORCELZO;
+#endif
+#ifdef CONFIG_JFFS2_ZLIB
+ else if (!strcmp(name, "zlib"))
+ c->mount_opts.compr =
+ JFFS2_COMPR_MODE_FORCEZLIB;
+#endif
+ else {
+ printk(KERN_ERR "JFFS2 Error: unknown compressor \"%s\"",
+ name);
+ kfree(name);
+ return -EINVAL;
}
kfree(name);
+ c->mount_opts.override_compr = true;
break;
default:
printk(KERN_ERR "JFFS2 Error: unrecognized mount option '%s' or missing value\n",