This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pooled memory allocation for JFFS2


On Fri, 2003-11-14 at 18:11 +0100, Thomas Koeller wrote:
> --- packages-orig/fs/jffs2/current/src/compr.c	2003-02-05 01:00:40.000000000 +0100
> +++ packages/fs/jffs2/current/src/compr.c	2003-11-12 18:28:56.000000000 +0100
> @@ -88,7 +88,7 @@
>  	memcpy(cpage_out,data_in,min(*datalen,*cdatalen));
>  	if (*datalen > *cdatalen)
>  		*datalen = *cdatalen;
> -#endif		
> +#endif
>  	return JFFS2_COMPR_NONE; /* We failed to compress */
>  
>  }

You can omit that one :)

> diff -ru packages-orig/fs/jffs2/current/src/fs-ecos.c packages/fs/jffs2/current/src/fs-ecos.c
> --- packages-orig/fs/jffs2/current/src/fs-ecos.c	2003-10-08 14:06:52.000000000 +0200
> +++ packages/fs/jffs2/current/src/fs-ecos.c	2003-11-13 18:17:07.000000000 +0100
> @@ -552,6 +552,7 @@
>  			return ENOMEM;
>  		}
>  		memset(c->inocache_list, 0, sizeof(struct jffs2_inode_cache *) * INOCACHE_HASHSIZE);
> +		jffs2_init_slab_caches();
>  
>  		err = jffs2_read_super(jffs2_sb);
>  

Sorry, I lied. It's jffs2_create_slab_caches() which is already present
in nodelist.h, not jffs2_init_slab_caches().

Also, you're calling it once for every JFFS2 file system mounted. You
should be doing it once precisely. 

> --- packages-orig/fs/jffs2/current/src/nodelist.h	2003-08-05 17:25:26.000000000 +0200
> +++ packages/fs/jffs2/current/src/nodelist.h	2003-11-13 13:19:10.000000000 +0100
> @@ -23,6 +23,7 @@
>  
>  #ifdef __ECOS
>  #include "os-ecos.h"
> +#include <pkgconf/fs_jffs2.h>
>  #else
>  #include <linux/mtd/compatmac.h> /* For min/max in older kernels */
>  #include "os-linux.h"

This could perhaps be added to os-ecos.h instead?

-- 
dwmw2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]