Squashfs: add decompressor entries for lzma and lzo
authorPhillip Lougher <phillip@lougher.demon.co.uk>
Wed, 14 Oct 2009 02:58:11 +0000 (03:58 +0100)
committerPhillip Lougher <phillip@lougher.demon.co.uk>
Wed, 20 Jan 2010 21:47:48 +0000 (21:47 +0000)
Add knowledge of lzma/lzo compression formats to the decompressor
framework.  For now these are added as unsupported.  Without
these entries lzma/lzo compressed filesystems will be flagged as
having unknown compression which is undesirable.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
fs/squashfs/decompressor.c
fs/squashfs/squashfs_fs.h

index 0072ccd..157478d 100644 (file)
  * Squashfs, allowing multiple decompressors to be easily supported
  */
 
+static const struct squashfs_decompressor squashfs_lzma_unsupported_comp_ops = {
+       NULL, NULL, NULL, LZMA_COMPRESSION, "lzma", 0
+};
+
+static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
+       NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
+};
+
 static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
        NULL, NULL, NULL, 0, "unknown", 0
 };
 
 static const struct squashfs_decompressor *decompressor[] = {
        &squashfs_zlib_comp_ops,
+       &squashfs_lzma_unsupported_comp_ops,
+       &squashfs_lzo_unsupported_comp_ops,
        &squashfs_unknown_comp_ops
 };
 
index 283daaf..36e1604 100644 (file)
@@ -211,7 +211,9 @@ struct meta_index {
 /*
  * definitions for structures on disk
  */
-#define ZLIB_COMPRESSION        1
+#define ZLIB_COMPRESSION       1
+#define LZMA_COMPRESSION       2
+#define LZO_COMPRESSION                3
 
 struct squashfs_super_block {
        __le32                  s_magic;