* JFFS2 uncompressed?
@ 2003-04-08 13:59 Steven Scholz
2003-04-08 14:19 ` Jörn Engel
0 siblings, 1 reply; 14+ messages in thread
From: Steven Scholz @ 2003-04-08 13:59 UTC (permalink / raw)
To: MTD
Hi there,
IIRC files are stored compressed on a JFFS2 partition.
Is there any chance that I could use JFFS2 without any compression?
I guess this might me faster for our embedded system!
Thanks,
Steven
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 13:59 JFFS2 uncompressed? Steven Scholz
@ 2003-04-08 14:19 ` Jörn Engel
2003-04-08 14:33 ` Steven Scholz
0 siblings, 1 reply; 14+ messages in thread
From: Jörn Engel @ 2003-04-08 14:19 UTC (permalink / raw)
To: Steven Scholz; +Cc: MTD
On Tue, 8 April 2003 15:59:35 +0200, Steven Scholz wrote:
>
> IIRC files are stored compressed on a JFFS2 partition.
>
> Is there any chance that I could use JFFS2 without any compression?
>
> I guess this might me faster for our embedded system!
Piece of cake.
Look at fs/jffs2/compr.c, first function. Add a couple of #if 0 and
you're done.
Do the same with the second function and the kernel image should
shrink a little.
Jörn
--
Beware of bugs in the above code; I have only proved it correct, but
not tried it.
-- Donald Knuth
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 14:19 ` Jörn Engel
@ 2003-04-08 14:33 ` Steven Scholz
2003-04-08 15:03 ` Jörn Engel
0 siblings, 1 reply; 14+ messages in thread
From: Steven Scholz @ 2003-04-08 14:33 UTC (permalink / raw)
To: Jörn Engel; +Cc: MTD
Jörn Engel schrieb:
> On Tue, 8 April 2003 15:59:35 +0200, Steven Scholz wrote:
>
>>IIRC files are stored compressed on a JFFS2 partition.
>>
>>Is there any chance that I could use JFFS2 without any compression?
>>
>>I guess this might me faster for our embedded system!
>
>
> Piece of cake.
> Look at fs/jffs2/compr.c, first function. Add a couple of #if 0 and
> you're done.
Thanks!
How about mkfs.jff2? Do I have to change something there as well?
> Do the same with the second function and the kernel image should
> shrink a little.
:o)
Steven
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 14:33 ` Steven Scholz
@ 2003-04-08 15:03 ` Jörn Engel
2003-04-08 15:06 ` Steven Scholz
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Jörn Engel @ 2003-04-08 15:03 UTC (permalink / raw)
To: Steven Scholz; +Cc: MTD
On Tue, 8 April 2003 16:33:45 +0200, Steven Scholz wrote:
>
> How about mkfs.jff2? Do I have to change something there as well?
Yes, you do. Shouldn't be much more complicated, but I didn't do it
myself yet.
Could you post a patch for mkfs.jffs2, when done? Just for the
curious.
Jörn
--
Anything that can go wrong, will.
-- Finagle's Law
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 15:03 ` Jörn Engel
@ 2003-04-08 15:06 ` Steven Scholz
2003-04-08 15:56 ` Jörn Engel
2003-04-08 15:43 ` Steven Scholz
2003-04-08 15:46 ` Steven Scholz
2 siblings, 1 reply; 14+ messages in thread
From: Steven Scholz @ 2003-04-08 15:06 UTC (permalink / raw)
To: Jörn Engel; +Cc: MTD
Jörn Engel schrieb:
> On Tue, 8 April 2003 16:33:45 +0200, Steven Scholz wrote:
>
>>How about mkfs.jff2? Do I have to change something there as well?
>
>
> Yes, you do. Shouldn't be much more complicated, but I didn't do it
> myself yet.
>
> Could you post a patch for mkfs.jffs2, when done? Just for the
> curious.
It's working! :o)
Would you like a define like
#define USE_COMPRESSION
or rather
#define DONT_USE_COMP
or something like that!?
BTW: Where could I put it so mkfs.jffs2 will find it?
Or should we add a command line option to mkfs.jffs2?
Steven
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 15:03 ` Jörn Engel
2003-04-08 15:06 ` Steven Scholz
@ 2003-04-08 15:43 ` Steven Scholz
2003-04-08 16:00 ` Jörn Engel
2003-04-08 15:46 ` Steven Scholz
2 siblings, 1 reply; 14+ messages in thread
From: Steven Scholz @ 2003-04-08 15:43 UTC (permalink / raw)
To: Jörn Engel; +Cc: MTD
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
Jörn Engel schrieb:
> On Tue, 8 April 2003 16:33:45 +0200, Steven Scholz wrote:
>
>>How about mkfs.jff2? Do I have to change something there as well?
>
>
> Yes, you do. Shouldn't be much more complicated, but I didn't do it
> myself yet.
>
> Could you post a patch for mkfs.jffs2, when done? Just for the
> curious.
Here you are!
Just a quick hack! :o) Enjoy!
Steven
[-- Attachment #2: jffs2-nocompress.patch --]
[-- Type: text/plain, Size: 2187 bytes --]
Index: util/mkfs.jffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
retrieving revision 1.36
diff -p -u -r1.36 mkfs.jffs2.c
--- util/mkfs.jffs2.c 3 Apr 2003 11:49:22 -0000 1.36
+++ util/mkfs.jffs2.c 8 Apr 2003 15:41:15 -0000
@@ -98,6 +98,7 @@ static int squash_uids = 0;
static int squash_perms = 0;
static int fake_times = 0;
static int target_endian = __BYTE_ORDER;
+static int do_compress = 1;
static const char *const app_name = "mkfs.jffs2";
static const char *const memory_exhausted = "memory exhausted";
@@ -691,6 +692,9 @@ unsigned char jffs2_compress(unsigned ch
{
int ret;
+ if (! do_compress)
+ return JFFS2_COMPR_NONE; /* We don't want to compress */
+
ret = jffs2_zlib_compress(data_in, cpage_out, datalen, cdatalen);
if (!ret) {
return JFFS2_COMPR_ZLIB;
@@ -1177,6 +1181,7 @@ static struct option long_options[] = {
{"no-cleanmarkers", 0, NULL, 'n'},
{"cleanmarker", 1, NULL, 'c'},
{"squash", 0, NULL, 'q'},
+ {"no-compression", 0, NULL, 'u'},
{"squash-uids", 0, NULL, 'U'},
{"squash-perms", 0, NULL, 'P'},
{"faketime", 0, NULL, 'f'},
@@ -1202,6 +1207,7 @@ static char *helptext =
" -D, --devtable=FILE Use the named FILE as a device table file\n"
" -f, --faketime Change all file times to '0' for regression testing\n"
" -q, --squash Squash permissions and owners making all files be owned by root\n"
+ " -u, --no-compression Don't use any compression\n"
" -U, --squash-uids Squash owners making all files be owned by root\n"
" -P, --squash-perms Squash permissions on all files\n"
" -h, --help Display this help text\n"
@@ -1220,7 +1226,7 @@ int main(int argc, char **argv)
struct filesystem_entry *root;
while ((opt = getopt_long(argc, argv,
- "D:d:r:s:o:qUPfh?vVe:lbp::nc:", long_options, &c)) >= 0)
+ "D:d:r:s:o:quUPfh?vVe:lbp::nc:", long_options, &c)) >= 0)
{
switch (opt) {
case 'D':
@@ -1256,6 +1262,10 @@ int main(int argc, char **argv)
case 'q':
squash_uids = 1;
squash_perms = 1;
+ break;
+
+ case 'u':
+ do_compress = 0;
break;
case 'U':
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 15:03 ` Jörn Engel
2003-04-08 15:06 ` Steven Scholz
2003-04-08 15:43 ` Steven Scholz
@ 2003-04-08 15:46 ` Steven Scholz
2 siblings, 0 replies; 14+ messages in thread
From: Steven Scholz @ 2003-04-08 15:46 UTC (permalink / raw)
To: Jörn Engel; +Cc: MTD
Hallo Jörn,
hab grad den Patch gesendet. Bekam aber ein
--------------
Your mail to 'linux-mtd' with the subject
Re: JFFS2 uncompressed?
Is being held until the list moderator can review it for approval.
The reason it is being held:
Message has a suspicious header
Either the message will get posted to the list, or you will receive
notification of the moderator's decision. If you would like to cancel
this posting, please visit the following URL:
------------------
Hast Du den Patch bekommen?
Steven
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 15:06 ` Steven Scholz
@ 2003-04-08 15:56 ` Jörn Engel
0 siblings, 0 replies; 14+ messages in thread
From: Jörn Engel @ 2003-04-08 15:56 UTC (permalink / raw)
To: Steven Scholz; +Cc: MTD
On Tue, 8 April 2003 17:06:34 +0200, Steven Scholz wrote:
>
> It's working! :o)
The good thing about clean code is that it's so easy to add ugly code
on top of it. :)
> Would you like a define like
>
> #define USE_COMPRESSION
>
> or rather
>
> #define DONT_USE_COMP
> or something like that!?
The change is simple enough already, no neef for more #ifdefs.
There is currently ongoing discussion about implementing conditional
compression in several places. Either per compile, as you did it, per
mount point or per inode.
Per inode is the most flexible, was already prepared a long time ago
and is imo the way. If/when this is done, the only reason to use your
simpler approach is to shrink the kernel image.
In short: don't bother.
> BTW: Where could I put it so mkfs.jffs2 will find it?
> Or should we add a command line option to mkfs.jffs2?
I'd prefer a command line option.
Jörn
--
The grand essentials of happiness are: something to do, something to
love, and something to hope for.
-- Allan K. Chalmers
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 15:43 ` Steven Scholz
@ 2003-04-08 16:00 ` Jörn Engel
2003-04-08 16:05 ` Steven Scholz
0 siblings, 1 reply; 14+ messages in thread
From: Jörn Engel @ 2003-04-08 16:00 UTC (permalink / raw)
To: Steven Scholz; +Cc: David Woodhouse, MTD
On Tue, 8 April 2003 17:43:07 +0200, Steven Scholz wrote:
> >
> >Could you post a patch for mkfs.jffs2, when done? Just for the
> >curious.
>
> Here you are!
>
> Just a quick hack! :o) Enjoy!
If you call this a quick hack, I'd like to see your clean code.
Thanks!
> Index: util/mkfs.jffs2.c
> ===================================================================
> RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
> retrieving revision 1.36
> diff -p -u -r1.36 mkfs.jffs2.c
> --- util/mkfs.jffs2.c 3 Apr 2003 11:49:22 -0000 1.36
> +++ util/mkfs.jffs2.c 8 Apr 2003 15:41:15 -0000
> @@ -98,6 +98,7 @@ static int squash_uids = 0;
> static int squash_perms = 0;
> static int fake_times = 0;
> static int target_endian = __BYTE_ORDER;
> +static int do_compress = 1;
> static const char *const app_name = "mkfs.jffs2";
> static const char *const memory_exhausted = "memory exhausted";
>
> @@ -691,6 +692,9 @@ unsigned char jffs2_compress(unsigned ch
> {
> int ret;
>
> + if (! do_compress)
> + return JFFS2_COMPR_NONE; /* We don't want to compress */
> +
> ret = jffs2_zlib_compress(data_in, cpage_out, datalen, cdatalen);
> if (!ret) {
> return JFFS2_COMPR_ZLIB;
> @@ -1177,6 +1181,7 @@ static struct option long_options[] = {
> {"no-cleanmarkers", 0, NULL, 'n'},
> {"cleanmarker", 1, NULL, 'c'},
> {"squash", 0, NULL, 'q'},
> + {"no-compression", 0, NULL, 'u'},
> {"squash-uids", 0, NULL, 'U'},
> {"squash-perms", 0, NULL, 'P'},
> {"faketime", 0, NULL, 'f'},
> @@ -1202,6 +1207,7 @@ static char *helptext =
> " -D, --devtable=FILE Use the named FILE as a device table file\n"
> " -f, --faketime Change all file times to '0' for regression testing\n"
> " -q, --squash Squash permissions and owners making all files be owned by root\n"
> + " -u, --no-compression Don't use any compression\n"
> " -U, --squash-uids Squash owners making all files be owned by root\n"
> " -P, --squash-perms Squash permissions on all files\n"
> " -h, --help Display this help text\n"
> @@ -1220,7 +1226,7 @@ int main(int argc, char **argv)
> struct filesystem_entry *root;
>
> while ((opt = getopt_long(argc, argv,
> - "D:d:r:s:o:qUPfh?vVe:lbp::nc:", long_options, &c)) >= 0)
> + "D:d:r:s:o:quUPfh?vVe:lbp::nc:", long_options, &c)) >= 0)
> {
> switch (opt) {
> case 'D':
> @@ -1256,6 +1262,10 @@ int main(int argc, char **argv)
> case 'q':
> squash_uids = 1;
> squash_perms = 1;
> + break;
> +
> + case 'u':
> + do_compress = 0;
> break;
>
> case 'U':
David, I don't see any obvious mistakes. Is it ok to apply?
Jörn
--
With a PC, I always felt limited by the software available. On Unix,
I am limited only by my knowledge.
-- Peter J. Schoenster
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 16:00 ` Jörn Engel
@ 2003-04-08 16:05 ` Steven Scholz
2003-04-08 16:08 ` David Woodhouse
0 siblings, 1 reply; 14+ messages in thread
From: Steven Scholz @ 2003-04-08 16:05 UTC (permalink / raw)
To: Jörn Engel; +Cc: MTD
Jörn Engel schrieb:
> On Tue, 8 April 2003 17:43:07 +0200, Steven Scholz wrote:
>
>>>Could you post a patch for mkfs.jffs2, when done? Just for the
>>>curious.
>>
>>Here you are!
>>
>>Just a quick hack! :o) Enjoy!
>
>
> If you call this a quick hack, I'd like to see your clean code.
> Thanks!
;-) I am flattered! Thanks!
Quick meant I did not try to use "--no-compress" only "-u" ...
But I'd love to see my name in the MTD Hall of Fame though! ;-)
Cheers,
Steven
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 16:05 ` Steven Scholz
@ 2003-04-08 16:08 ` David Woodhouse
2003-04-08 16:30 ` Thayne Harbaugh
2003-04-11 6:44 ` Steven Scholz
0 siblings, 2 replies; 14+ messages in thread
From: David Woodhouse @ 2003-04-08 16:08 UTC (permalink / raw)
To: Steven Scholz; +Cc: MTD, Jörn Engel
On Tue, 2003-04-08 at 17:05, Steven Scholz wrote:
> But I'd love to see my name in the MTD Hall of Fame though! ;-)
Send me a SSH key and you can commit your patch and at least get your
name in the $Id$ tag and the changelog... :)
--
dwmw2
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 16:08 ` David Woodhouse
@ 2003-04-08 16:30 ` Thayne Harbaugh
2003-04-08 16:33 ` David Woodhouse
2003-04-11 6:44 ` Steven Scholz
1 sibling, 1 reply; 14+ messages in thread
From: Thayne Harbaugh @ 2003-04-08 16:30 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd, Steven Scholz
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
On Tue, 2003-04-08 at 10:08, David Woodhouse wrote:
> On Tue, 2003-04-08 at 17:05, Steven Scholz wrote:
> > But I'd love to see my name in the MTD Hall of Fame though! ;-)
For us, it's the cheap thrill of having our name in the MTD Hall of Fame
. . .
>
> Send me a SSH key and you can commit your patch and at least get your
> name in the $Id$ tag and the changelog... :)
For Dave, it's that he's just too lazy to commit the patches we send him
. . .
;^)
--
Thayne Harbaugh
Linux Networx
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 16:30 ` Thayne Harbaugh
@ 2003-04-08 16:33 ` David Woodhouse
0 siblings, 0 replies; 14+ messages in thread
From: David Woodhouse @ 2003-04-08 16:33 UTC (permalink / raw)
To: Thayne Harbaugh; +Cc: linux-mtd, Steven Scholz
On Tue, 2003-04-08 at 17:30, Thayne Harbaugh wrote:
> For Dave, it's that he's just too lazy to commit the patches we send him
So true. And if you commit it yourself I know who to blame when three
weeks later it turns out to be broken. :)
--
dwmw2
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: JFFS2 uncompressed?
2003-04-08 16:08 ` David Woodhouse
2003-04-08 16:30 ` Thayne Harbaugh
@ 2003-04-11 6:44 ` Steven Scholz
1 sibling, 0 replies; 14+ messages in thread
From: Steven Scholz @ 2003-04-11 6:44 UTC (permalink / raw)
To: David Woodhouse; +Cc: Jörn Engel, MTD
David Woodhouse schrieb:
> On Tue, 2003-04-08 at 17:05, Steven Scholz wrote:
>
>>But I'd love to see my name in the MTD Hall of Fame though! ;-)
>
>
> Send me a SSH key and you can commit your patch and at least get your
> name in the $Id$ tag and the changelog... :)
Do you need an entry for the man page as well?
Steven
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2003-04-11 6:44 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-08 13:59 JFFS2 uncompressed? Steven Scholz
2003-04-08 14:19 ` Jörn Engel
2003-04-08 14:33 ` Steven Scholz
2003-04-08 15:03 ` Jörn Engel
2003-04-08 15:06 ` Steven Scholz
2003-04-08 15:56 ` Jörn Engel
2003-04-08 15:43 ` Steven Scholz
2003-04-08 16:00 ` Jörn Engel
2003-04-08 16:05 ` Steven Scholz
2003-04-08 16:08 ` David Woodhouse
2003-04-08 16:30 ` Thayne Harbaugh
2003-04-08 16:33 ` David Woodhouse
2003-04-11 6:44 ` Steven Scholz
2003-04-08 15:46 ` Steven Scholz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox