Date:2010-09-11 05:06:17 (12 years 26 days ago)
Author:Phillip Lougher
Commit:330dac38a67f65ba7d0ee6f6ba88ca373c936b22
Message:Squashfs: Make unlzma available to non initramfs/initrd code

Add a config option DECOMPRESS_LZMA_NEEDED which allows subsystems to
specify they need the unlzma code. Normally decompress_unlzma.c is
compiled with __init and unlzma is not exported to modules.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Files: fs/squashfs/Kconfig (1 diff)
include/linux/decompress/bunzip2_mm.h (1 diff)
include/linux/decompress/inflate_mm.h (1 diff)
include/linux/decompress/mm.h (2 diffs)
include/linux/decompress/unlzma_mm.h (1 diff)
lib/Kconfig (1 diff)
lib/decompress_bunzip2.c (1 diff)
lib/decompress_inflate.c (1 diff)
lib/decompress_unlzma.c (3 diffs)

Change Details

fs/squashfs/Kconfig
4141    bool "Include support for LZMA compressed file systems"
4242    depends on SQUASHFS
4343    select DECOMPRESS_LZMA
44    select DECOMPRESS_LZMA_NEEDED
4445
4546config SQUASHFS_EMBEDDED
4647
include/linux/decompress/bunzip2_mm.h
1#ifndef BUNZIP2_MM_H
2#define BUNZIP2_MM_H
3
4#ifdef STATIC
5/* Code active when included from pre-boot environment: */
6#define INIT
7#else
8/* Compile for initramfs/initrd code only */
9#define INIT __init
10#endif
11
12#endif
include/linux/decompress/inflate_mm.h
1#ifndef INFLATE_MM_H
2#define INFLATE_MM_H
3
4#ifdef STATIC
5/* Code active when included from pre-boot environment: */
6#define INIT
7#else
8/* Compile for initramfs/initrd code only */
9#define INIT __init
10#endif
11
12#endif
include/linux/decompress/mm.h
6363
6464#define set_error_fn(x)
6565
66#define INIT
67
6866#else /* STATIC */
6967
7068/* Code active when compiled standalone for use when loading ramdisk: */
...... 
8785static void(*error)(char *m);
8886#define set_error_fn(x) error = x;
8987
90#define INIT __init
9188#define STATIC
9289
9390#include <linux/init.h>
include/linux/decompress/unlzma_mm.h
1#ifndef UNLZMA_MM_H
2#define UNLZMA_MM_H
3
4#ifdef STATIC
5
6/* Code active when included from pre-boot environment: */
7#define INIT
8
9#elif defined(CONFIG_DECOMPRESS_LZMA_NEEDED)
10
11/* Make it available to non initramfs/initrd code */
12#define INIT
13#include <linux/module.h>
14#else
15
16/* Compile for initramfs/initrd code only */
17#define INIT __init
18#endif
19
20#endif
lib/Kconfig
121121    select LZO_DECOMPRESS
122122    tristate
123123
124config DECOMPRESS_LZMA_NEEDED
125     boolean
126
124127#
125128# Generic allocator support is selected if needed
126129#
lib/decompress_bunzip2.c
5252#include <linux/slab.h>
5353#endif /* STATIC */
5454
55#include <linux/decompress/bunzip2_mm.h>
5556#include <linux/decompress/mm.h>
5657
5758#ifndef INT_MAX
lib/decompress_inflate.c
2323
2424#endif /* STATIC */
2525
26#include <linux/decompress/inflate_mm.h>
2627#include <linux/decompress/mm.h>
2728
2829#define GZIP_IOBUF_SIZE (16*1024)
lib/decompress_unlzma.c
3636#include <linux/slab.h>
3737#endif /* STATIC */
3838
39#include <linux/decompress/unlzma_mm.h>
3940#include <linux/decompress/mm.h>
4041
4142#define MIN(a, b) (((a) < (b)) ? (a) : (b))
...... 
531532
532533
533534
534STATIC inline int INIT unlzma(unsigned char *buf, int in_len,
535STATIC int INIT unlzma(unsigned char *buf, int in_len,
535536                  int(*fill)(void*, unsigned int),
536537                  int(*flush)(void*, unsigned int),
537538                  unsigned char *output,
...... 
664665{
665666    return unlzma(buf, in_len - 4, fill, flush, output, posp, error_fn);
666667}
668#elif defined(CONFIG_DECOMPRESS_LZMA_NEEDED)
669EXPORT_SYMBOL(unlzma);
667670#endif

Archive Download the corresponding diff file



interactive