diff options
Diffstat (limited to 'meta/packages/mtd/mtd-utils/favour_lzo.patch')
-rw-r--r-- | meta/packages/mtd/mtd-utils/favour_lzo.patch | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/meta/packages/mtd/mtd-utils/favour_lzo.patch b/meta/packages/mtd/mtd-utils/favour_lzo.patch index 9e55d5f4b3..8b1581c467 100644 --- a/meta/packages/mtd/mtd-utils/favour_lzo.patch +++ b/meta/packages/mtd/mtd-utils/favour_lzo.patch | |||
@@ -1,3 +1,5 @@ | |||
1 | Subject: [mtd-utils patch 2/2] Add favourlzo compression mode | ||
2 | |||
1 | Add a favourlzo compression mode to mtd-utils | 3 | Add a favourlzo compression mode to mtd-utils |
2 | 4 | ||
3 | This allows lzo compression to be used in the cases where the | 5 | This allows lzo compression to be used in the cases where the |
@@ -35,21 +37,21 @@ Index: git/compr.c | |||
35 | + struct jffs2_compressor *best, uint32_t size, uint32_t bestsize) | 37 | + struct jffs2_compressor *best, uint32_t size, uint32_t bestsize) |
36 | +{ | 38 | +{ |
37 | + switch (jffs2_compression_mode) { | 39 | + switch (jffs2_compression_mode) { |
38 | + case JFFS2_COMPR_MODE_SIZE: | 40 | + case JFFS2_COMPR_MODE_SIZE: |
39 | + if (bestsize > size) | 41 | + if (bestsize > size) |
40 | + return 1; | 42 | + return 1; |
41 | + return 0; | 43 | + return 0; |
42 | + case JFFS2_COMPR_MODE_FAVOURLZO: | 44 | + case JFFS2_COMPR_MODE_FAVOURLZO: |
43 | + if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size)) | 45 | + if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size)) |
44 | + return 1; | 46 | + return 1; |
45 | + if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size)) | 47 | + if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size)) |
46 | + return 1; | 48 | + return 1; |
47 | + if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100))) | 49 | + if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100))) |
48 | + return 1; | 50 | + return 1; |
49 | + if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size) | 51 | + if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size) |
50 | + return 1; | 52 | + return 1; |
51 | + | 53 | + |
52 | + return 0; | 54 | + return 0; |
53 | + } | 55 | + } |
54 | + /* Shouldn't happen */ | 56 | + /* Shouldn't happen */ |
55 | + return 0; | 57 | + return 0; |
@@ -70,9 +72,9 @@ Index: git/compr.c | |||
70 | + uint32_t needed_buf_size; | 72 | + uint32_t needed_buf_size; |
71 | + | 73 | + |
72 | + if (jffs2_compression_mode == JFFS2_COMPR_MODE_FAVOURLZO) | 74 | + if (jffs2_compression_mode == JFFS2_COMPR_MODE_FAVOURLZO) |
73 | + needed_buf_size = orig_slen+jffs2_compression_check; | 75 | + needed_buf_size = orig_slen + jffs2_compression_check; |
74 | + else | 76 | + else |
75 | + needed_buf_size = orig_dlen+jffs2_compression_check; | 77 | + needed_buf_size = orig_dlen + jffs2_compression_check; |
76 | + | 78 | + |
77 | /* Skip decompress-only backwards-compatibility and disabled modules */ | 79 | /* Skip decompress-only backwards-compatibility and disabled modules */ |
78 | if ((!this->compress)||(this->disabled)) | 80 | if ((!this->compress)||(this->disabled)) |
@@ -105,7 +107,7 @@ Index: git/compr.c | |||
105 | act_buf += sprintf(act_buf,"size"); | 107 | act_buf += sprintf(act_buf,"size"); |
106 | break; | 108 | break; |
107 | + case JFFS2_COMPR_MODE_FAVOURLZO: | 109 | + case JFFS2_COMPR_MODE_FAVOURLZO: |
108 | + act_buf += sprintf(act_buf,"favourlzo"); | 110 | + act_buf += sprintf(act_buf, "favourlzo"); |
109 | + break; | 111 | + break; |
110 | default: | 112 | default: |
111 | act_buf += sprintf(act_buf,"unkown"); | 113 | act_buf += sprintf(act_buf,"unkown"); |
@@ -134,3 +136,5 @@ Index: git/compr.h | |||
134 | 136 | ||
135 | #define kmalloc(a,b) malloc(a) | 137 | #define kmalloc(a,b) malloc(a) |
136 | #define kfree(a) free(a) | 138 | #define kfree(a) free(a) |
139 | |||
140 | |||