aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/compr.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-13 13:12:15 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-13 13:12:15 -0400
commitc8c55bcb43d790d97790cfa319d80045a71fde39 (patch)
treeb791d9478d3e7f1eb26e51bb999fde21847d4391 /fs/jffs2/compr.h
parent3749c66c67fb5c257771815c186bc32290cacf44 (diff)
parentebf8889bd1fe3615991ff4494635d237280652a2 (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (91 commits) [MTD] [NAND] Blackfin on-chip NAND Flash Controller driver [MTD] [NOR] fix ctrl-alt-del can't reboot for intel flash bug [MTD] [NAND] Fix compiler warning in Alauda driver [JFFS2] Remove stray debugging printk [JFFS2] Handle dirents on the flash with embedded zero bytes in names. [JFFS2] Check for creation of dirents with embedded zero bytes in name. [JFFS2] Don't count all 'very dirty' blocks except in debug mode [JFFS2] Check whether garbage-collection actually obsoleted its victim. [JFFS2] Relax threshold for triggering GC due to dirty blocks. [MTD] [OneNAND] Fix typo related with recent commit [JFFS2] Trigger garbage collection when very_dirty_list size becomes excessive [MTD] [NAND] Avoid deadlock in erase callback; release chip lock first. [MTD] [NAND] Resume method for CAFÉ NAND controller [MTD] [NAND] Fix PCI ident table for CAFÉ NAND controller. [MTD] [NAND] s3c2410: fix arch moves [MTD] [OneNAND] fix numerous races [MTD] map driver for NOR flash on the Intel Vermilion Range chipset [JFFS2] Fix unpoint length [MTD] fix CFI point method for discontiguous maps [MTD] MAPS: Merge Lubbock and Mainstone drivers into common PXA2xx driver ...
Diffstat (limited to 'fs/jffs2/compr.h')
-rw-r--r--fs/jffs2/compr.h54
1 files changed, 31 insertions, 23 deletions
diff --git a/fs/jffs2/compr.h b/fs/jffs2/compr.h
index 68cc7010dbdf..7d1d72faa774 100644
--- a/fs/jffs2/compr.h
+++ b/fs/jffs2/compr.h
@@ -2,7 +2,7 @@
2 * JFFS2 -- Journalling Flash File System, Version 2. 2 * JFFS2 -- Journalling Flash File System, Version 2.
3 * 3 *
4 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>, 4 * Copyright © 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
5 * University of Szeged, Hungary 5 * University of Szeged, Hungary
6 * 6 *
7 * For licensing information, see the file 'LICENCE' in this directory. 7 * For licensing information, see the file 'LICENCE' in this directory.
8 * 8 *
@@ -27,34 +27,38 @@
27#define JFFS2_RUBINMIPS_PRIORITY 10 27#define JFFS2_RUBINMIPS_PRIORITY 10
28#define JFFS2_DYNRUBIN_PRIORITY 20 28#define JFFS2_DYNRUBIN_PRIORITY 20
29#define JFFS2_LZARI_PRIORITY 30 29#define JFFS2_LZARI_PRIORITY 30
30#define JFFS2_LZO_PRIORITY 40
31#define JFFS2_RTIME_PRIORITY 50 30#define JFFS2_RTIME_PRIORITY 50
32#define JFFS2_ZLIB_PRIORITY 60 31#define JFFS2_ZLIB_PRIORITY 60
32#define JFFS2_LZO_PRIORITY 80
33
33 34
34#define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */ 35#define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */
35#define JFFS2_DYNRUBIN_DISABLED /* for decompression */ 36#define JFFS2_DYNRUBIN_DISABLED /* for decompression */
36 37
37#define JFFS2_COMPR_MODE_NONE 0 38#define JFFS2_COMPR_MODE_NONE 0
38#define JFFS2_COMPR_MODE_PRIORITY 1 39#define JFFS2_COMPR_MODE_PRIORITY 1
39#define JFFS2_COMPR_MODE_SIZE 2 40#define JFFS2_COMPR_MODE_SIZE 2
41#define JFFS2_COMPR_MODE_FAVOURLZO 3
42
43#define FAVOUR_LZO_PERCENT 80
40 44
41struct jffs2_compressor { 45struct jffs2_compressor {
42 struct list_head list; 46 struct list_head list;
43 int priority; /* used by prirority comr. mode */ 47 int priority; /* used by prirority comr. mode */
44 char *name; 48 char *name;
45 char compr; /* JFFS2_COMPR_XXX */ 49 char compr; /* JFFS2_COMPR_XXX */
46 int (*compress)(unsigned char *data_in, unsigned char *cpage_out, 50 int (*compress)(unsigned char *data_in, unsigned char *cpage_out,
47 uint32_t *srclen, uint32_t *destlen, void *model); 51 uint32_t *srclen, uint32_t *destlen, void *model);
48 int (*decompress)(unsigned char *cdata_in, unsigned char *data_out, 52 int (*decompress)(unsigned char *cdata_in, unsigned char *data_out,
49 uint32_t cdatalen, uint32_t datalen, void *model); 53 uint32_t cdatalen, uint32_t datalen, void *model);
50 int usecount; 54 int usecount;
51 int disabled; /* if seted the compressor won't compress */ 55 int disabled; /* if set the compressor won't compress */
52 unsigned char *compr_buf; /* used by size compr. mode */ 56 unsigned char *compr_buf; /* used by size compr. mode */
53 uint32_t compr_buf_size; /* used by size compr. mode */ 57 uint32_t compr_buf_size; /* used by size compr. mode */
54 uint32_t stat_compr_orig_size; 58 uint32_t stat_compr_orig_size;
55 uint32_t stat_compr_new_size; 59 uint32_t stat_compr_new_size;
56 uint32_t stat_compr_blocks; 60 uint32_t stat_compr_blocks;
57 uint32_t stat_decompr_blocks; 61 uint32_t stat_decompr_blocks;
58}; 62};
59 63
60int jffs2_register_compressor(struct jffs2_compressor *comp); 64int jffs2_register_compressor(struct jffs2_compressor *comp);
@@ -64,12 +68,12 @@ int jffs2_compressors_init(void);
64int jffs2_compressors_exit(void); 68int jffs2_compressors_exit(void);
65 69
66uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, 70uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
67 unsigned char *data_in, unsigned char **cpage_out, 71 unsigned char *data_in, unsigned char **cpage_out,
68 uint32_t *datalen, uint32_t *cdatalen); 72 uint32_t *datalen, uint32_t *cdatalen);
69 73
70int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, 74int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
71 uint16_t comprtype, unsigned char *cdata_in, 75 uint16_t comprtype, unsigned char *cdata_in,
72 unsigned char *data_out, uint32_t cdatalen, uint32_t datalen); 76 unsigned char *data_out, uint32_t cdatalen, uint32_t datalen);
73 77
74void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig); 78void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
75 79
@@ -90,5 +94,9 @@ void jffs2_rtime_exit(void);
90int jffs2_zlib_init(void); 94int jffs2_zlib_init(void);
91void jffs2_zlib_exit(void); 95void jffs2_zlib_exit(void);
92#endif 96#endif
97#ifdef CONFIG_JFFS2_LZO
98int jffs2_lzo_init(void);
99void jffs2_lzo_exit(void);
100#endif
93 101
94#endif /* __JFFS2_COMPR_H__ */ 102#endif /* __JFFS2_COMPR_H__ */