public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problems with new JFFS2 compress infrastructure
@ 2004-09-15 12:17 eibach
  2004-09-15 12:32 ` Gary Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: eibach @ 2004-09-15 12:17 UTC (permalink / raw)
  To: ecos-discuss

Hello,

I'm working with ecos CVS from 2004/09/06.

In source code defines like "CONFIG_JFFS2_ZLIB" are used. 
In jffs2.cdl defines like "JFFS2_USE_ZLIB" are used. 
This names don't match, and I don't find any other place where "CONFIG_JFFS2_ZLIB " is defined.
In consequence when I build ecos, jffs2 compression is not active although it is activated in the configuration.

So the cdl doesn't seem to match the source code.

Am I missing something obvious or is the cdl simply outdated?

Regards,
Dirk


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Problems with new JFFS2 compress infrastructure
  2004-09-15 12:17 [ECOS] Problems with new JFFS2 compress infrastructure eibach
@ 2004-09-15 12:32 ` Gary Thomas
  0 siblings, 0 replies; 4+ messages in thread
From: Gary Thomas @ 2004-09-15 12:32 UTC (permalink / raw)
  To: eibach; +Cc: ecos-discuss

On Wed, 2004-09-15 at 04:55, eibach@gdsys.de wrote:
> Hello,
> 
> I'm working with ecos CVS from 2004/09/06.
> 
> In source code defines like "CONFIG_JFFS2_ZLIB" are used. 
> In jffs2.cdl defines like "JFFS2_USE_ZLIB" are used. 
> This names don't match, and I don't find any other place where "CONFIG_JFFS2_ZLIB " is defined.
> In consequence when I build ecos, jffs2 compression is not active although it is activated in the configuration.
> 
> So the cdl doesn't seem to match the source code.
> 
> Am I missing something obvious or is the cdl simply outdated?

I think this is the case - there were some changes in this
area in the JFFS2 code recently and it looks like they weren't
reflected into the CDL.

Perhaps you can figure out the changes and send a patch?

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Problems with new JFFS2 compress infrastructure
  2004-09-16 14:12 eibach
@ 2004-09-19 14:27 ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2004-09-19 14:27 UTC (permalink / raw)
  To: eibach; +Cc: gary, ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

On Thu, Sep 16, 2004 at 02:09:59PM +0000, eibach@gdsys.de wrote:
> Hi,
> 
> > > Am I missing something obvious or is the cdl simply outdated?
> > 
> > I think this is the case - there were some changes in this
> > area in the JFFS2 code recently and it looks like they weren't
> > reflected into the CDL.
> > 
> > Perhaps you can figure out the changes and send a patch?
> 
> I've attached the patch. Works fine for me.

There was one new option you missed which i have added.

        Andrew

[-- Attachment #2: ecos_jffs2.diff --]
[-- Type: text/plain, Size: 6979 bytes --]

Index: fs/jffs2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/ChangeLog,v
retrieving revision 1.36
diff -u -r1.36 ChangeLog
--- fs/jffs2/current/ChangeLog	13 Aug 2004 10:55:27 -0000	1.36
+++ fs/jffs2/current/ChangeLog	19 Sep 2004 14:25:24 -0000
@@ -1,3 +1,10 @@
+2004-09-16  Dirk Eibach  <eibach@gdsys.de>
+2004-09-19  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* cdl/jffs2.cdl: Fixed outdated definitions for compression options.
+	* src/fs-ecos.c: Added missing calls for jffs2_compressors_init()
+        and jffs2_compressors_exit() 
+
 2004-08-13  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/compr.h: Committed this file which if forgot yesterday.
Index: fs/jffs2/current/cdl/jffs2.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl,v
retrieving revision 1.17
diff -u -r1.17 jffs2.cdl
--- fs/jffs2/current/cdl/jffs2.cdl	12 Aug 2004 21:35:27 -0000	1.17
+++ fs/jffs2/current/cdl/jffs2.cdl	19 Sep 2004 14:25:24 -0000
@@ -119,7 +119,7 @@
             fairly verbose output. Level 2 is insanely loquacious."
     }
 
-    cdl_option CYGOPT_FS_JFFS2_COMPRESS {
+    cdl_component CYGOPT_FS_JFFS2_COMPRESS {
         display         "Compress data"
         flavor          bool
         define          JFFS2_COMPRESSION
@@ -130,47 +130,56 @@
             selecting this option increases the amount of RAM required and
             slows down read and write operations considerably if you have a
             slow CPU."
-    }
 
-    cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB {
-        display         "Compress data using zlib"
-        flavor          bool
-        define          JFFS2_USE_ZLIB
-        requires        CYGPKG_COMPRESS_ZLIB
-        requires        CYGOPT_FS_JFFS2_COMPRESS
-        compile         compr_zlib.c
-        default_value   1
-        description     "
-            Use zlib for compression of data. This is the slowest of the
-            compression options available but the most effective."
-    }
+        cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB {
+            display         "Compress data using zlib"
+            flavor          bool
+            define          CONFIG_JFFS2_ZLIB
+            requires        CYGPKG_COMPRESS_ZLIB
+            compile         compr_zlib.c
+            default_value   1
+            description     "
+                Use zlib for compression of data. This is the slowest of the
+                compression options available but the most effective."
+        }
 
-    cdl_option CYGOPT_FS_JFFS2_COMPRESS_RTIME {
-        display         "Compress data using rtime"
-        flavor          bool
-        define          JFFS2_USE_RTIME
-        requires        CYGOPT_FS_JFFS2_COMPRESS
-        compile         compr_rtime.c
-        default_value   1
-        description     "
-            Use the rtime algorithm for compression of data. This 
-            simple algorithm often manages to squeeze and extra few
-            bytes from data already compressed with gzip."
-    }
+        cdl_option CYGOPT_FS_JFFS2_COMPRESS_RTIME {
+            display         "Compress data using rtime"
+            flavor          bool
+            define          CONFIG_JFFS2_RTIME
+            compile         compr_rtime.c
+            default_value   1
+            description     "
+                Use the rtime algorithm for compression of data. This 
+                simple algorithm often manages to squeeze and extra few
+                bytes from data already compressed with gzip."
+        }
 
-    cdl_option CYGOPT_FS_JFFS2_COMPRESS_RUBIN {
-        display         "Compress data using rubin"
-        flavor          bool
-        define          JFFS2_USE_RTIME
-        requires        CYGOPT_FS_JFFS2_COMPRESS
-        compile         compr_rubin.c
-        default_value   !CYGOPT_FS_JFFS2_COMPRESS_ZLIB
-        description     "
-            Use the rubin algorithm for compression of data. This 
-            simple algorithm is faster than zlib but not quite as
-            effective."
+        cdl_option CYGOPT_FS_JFFS2_COMPRESS_RUBIN {
+            display         "Compress data using rubin"
+            flavor          bool
+            define          CONFIG_JFFS2_RUBIN
+            requires        CYGOPT_FS_JFFS2_COMPRESS
+            compile         compr_rubin.c
+            description     "
+                Use the rubin algorithm for compression of data. This 
+                simple algorithm is faster than zlib but not quite as
+                effective."
+        }
+        cdl_option CYGOPT_FS_JFFS2_COMPRESS_CMODE {
+            display         "Set the default compression mode"
+            flavor          data
+            default_value   { "PRIORITY" }
+            legal_values    { "NONE" "PRIORITY" "SIZE" }
+            define          CONFIG_JFFS2_CMODE
+            description     "
+                You can set here the default compression mode of JFFS2 from 
+                the avaiable compression modes. NONE causes no compression to
+                be performed. PRIORITY tries the compressors in a predefined
+                order and chooses the first successfull one. SIZE tries all 
+                compressors and chooses the one which has the smallest result"
+        }
     }
-
     cdl_option CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE {
         display         "Memory pool size"
         flavor          data
Index: fs/jffs2/current/src/fs-ecos.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/fs-ecos.c,v
retrieving revision 1.28
diff -u -r1.28 fs-ecos.c
--- fs/jffs2/current/src/fs-ecos.c	12 Aug 2004 21:35:28 -0000	1.28
+++ fs/jffs2/current/src/fs-ecos.c	19 Sep 2004 14:25:26 -0000
@@ -21,6 +21,7 @@
 #include <linux/pagemap.h>
 #include <linux/crc32.h>
 #include "nodelist.h"
+#include "compr.h"
 
 #include <errno.h>
 #include <string.h>
@@ -543,14 +544,18 @@
 			return ENOMEM;
 		}
 		memset(c->inocache_list, 0, sizeof(struct jffs2_inode_cache *) * INOCACHE_HASHSIZE);
-                if (n_fs_mounted++ == 0)
+                if (n_fs_mounted++ == 0) {
                         jffs2_create_slab_caches(); // No error check, cannot fail
+			jffs2_compressors_init(); 
+		}
 
 		err = jffs2_read_super(jffs2_sb);
 
 		if (err) {
-                        if (--n_fs_mounted == 0)
+                        if (--n_fs_mounted == 0) {
                                 jffs2_destroy_slab_caches();
+				jffs2_compressors_exit();
+			}
                         
 			free(jffs2_sb);
 			free(c->inocache_list);
@@ -662,8 +667,10 @@
 	} else {
 		jffs2_sb->s_mount_count--;
         }
-        if (--n_fs_mounted == 0)
+        if (--n_fs_mounted == 0) {
                 jffs2_destroy_slab_caches();        
+		jffs2_compressors_exit();
+	}
 	return ENOERR;
 }
 


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Problems with new JFFS2 compress infrastructure
@ 2004-09-16 14:12 eibach
  2004-09-19 14:27 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: eibach @ 2004-09-16 14:12 UTC (permalink / raw)
  To: gary; +Cc: ecos-discuss

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

Hi,

> > Am I missing something obvious or is the cdl simply outdated?
> 
> I think this is the case - there were some changes in this
> area in the JFFS2 code recently and it looks like they weren't
> reflected into the CDL.
> 
> Perhaps you can figure out the changes and send a patch?

I've attached the patch. Works fine for me.

Regards,
Dirk

To: gary@mlbassoc.com
Cc: ecos-discuss@sources.redhat.com


[-- Attachment #2: ecos_jffs2.diff --]
[-- Type: application/octet-stream, Size: 3725 bytes --]

diff -ur cvs_public_04_09_06/ecos/packages/fs/jffs2/current/ChangeLog gd_04_09_06/ecos/packages/fs/jffs2/current/ChangeLog
--- cvs_public_04_09_06/ecos/packages/fs/jffs2/current/ChangeLog	2004-08-13 12:55:27.000000000 +0200
+++ gd_04_09_06/ecos/packages/fs/jffs2/current/ChangeLog	2004-09-16 15:51:18.430598400 +0200
@@ -1,3 +1,9 @@
+2004-09-16  Dirk Eibach  <eibach@gdsys.de>
+
+	* cdl/jffs2.cdl: Fixed outdated definitions for compression options.
+	* src/fs-ecos.c: Added missing calls for jffs2_compressors_init()
+	   and jffs2_compressors_exit() 
+
 2004-08-13  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/compr.h: Committed this file which if forgot yesterday.
diff -ur cvs_public_04_09_06/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl gd_04_09_06/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl
--- cvs_public_04_09_06/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl	2004-08-12 23:35:27.000000000 +0200
+++ gd_04_09_06/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl	2004-09-15 15:34:45.941825600 +0200
@@ -135,7 +135,7 @@
     cdl_option CYGOPT_FS_JFFS2_COMPRESS_ZLIB {
         display         "Compress data using zlib"
         flavor          bool
-        define          JFFS2_USE_ZLIB
+        define          CONFIG_JFFS2_ZLIB
         requires        CYGPKG_COMPRESS_ZLIB
         requires        CYGOPT_FS_JFFS2_COMPRESS
         compile         compr_zlib.c
@@ -148,7 +148,7 @@
     cdl_option CYGOPT_FS_JFFS2_COMPRESS_RTIME {
         display         "Compress data using rtime"
         flavor          bool
-        define          JFFS2_USE_RTIME
+        define          CONFIG_JFFS2_RTIME
         requires        CYGOPT_FS_JFFS2_COMPRESS
         compile         compr_rtime.c
         default_value   1
@@ -161,7 +161,7 @@
     cdl_option CYGOPT_FS_JFFS2_COMPRESS_RUBIN {
         display         "Compress data using rubin"
         flavor          bool
-        define          JFFS2_USE_RTIME
+        define          CONFIG_JFFS2_RUBIN
         requires        CYGOPT_FS_JFFS2_COMPRESS
         compile         compr_rubin.c
         default_value   !CYGOPT_FS_JFFS2_COMPRESS_ZLIB
diff -ur cvs_public_04_09_06/ecos/packages/fs/jffs2/current/src/fs-ecos.c gd_04_09_06/ecos/packages/fs/jffs2/current/src/fs-ecos.c
--- cvs_public_04_09_06/ecos/packages/fs/jffs2/current/src/fs-ecos.c	2004-08-12 23:35:28.000000000 +0200
+++ gd_04_09_06/ecos/packages/fs/jffs2/current/src/fs-ecos.c	2004-09-16 15:43:02.076876800 +0200
@@ -21,6 +21,7 @@
 #include <linux/pagemap.h>
 #include <linux/crc32.h>
 #include "nodelist.h"
+#include "compr.h"
 
 #include <errno.h>
 #include <string.h>
@@ -543,14 +544,18 @@
 			return ENOMEM;
 		}
 		memset(c->inocache_list, 0, sizeof(struct jffs2_inode_cache *) * INOCACHE_HASHSIZE);
-                if (n_fs_mounted++ == 0)
+                if (n_fs_mounted++ == 0) {
                         jffs2_create_slab_caches(); // No error check, cannot fail
+			jffs2_compressors_init();// Init new jffs2 compress infastructure
+		}
 
 		err = jffs2_read_super(jffs2_sb);
 
 		if (err) {
-                        if (--n_fs_mounted == 0)
+                        if (--n_fs_mounted == 0) {
                                 jffs2_destroy_slab_caches();
+				jffs2_compressors_exit();// Deinit new jffs2 compress infastructure
+			}
                         
 			free(jffs2_sb);
 			free(c->inocache_list);
@@ -662,8 +667,10 @@
 	} else {
 		jffs2_sb->s_mount_count--;
         }
-        if (--n_fs_mounted == 0)
+        if (--n_fs_mounted == 0) {
                 jffs2_destroy_slab_caches();        
+		jffs2_compressors_exit();// Deinit new jffs2 compress infastructure
+	}
 	return ENOERR;
 }

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-19 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 12:17 [ECOS] Problems with new JFFS2 compress infrastructure eibach
2004-09-15 12:32 ` Gary Thomas
2004-09-16 14:12 eibach
2004-09-19 14:27 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).