[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gc problem?



On Mon, 17 November 2003 14:12:16 +0100, Bernhard Roessmann wrote:
> 
> Additional question: Is it possible to disable JFFS2 compression? In my 
> application, size ist not the problem, but speed is.

Try the patch below.  It is brute force, but should work.  Not sure if
garbage collection will expand the data or just copy the old
compressed data around, if you have old, compressed images, though.

Jörn

-- 
Fancy algorithms are slow when n is small, and n is usually small.
Fancy algorithms have big constants. Until you know that n is
frequently going to be big, don't get fancy.
-- Rob Pike

--- /usr/src/linux/fs/jffs2/compr.c	Fri Oct  5 00:13:18 2001
+++ /tmp/compr.c	Mon Nov 17 16:02:12 2003
@@ -71,37 +71,6 @@
 unsigned char jffs2_compress(unsigned char *data_in, unsigned char *cpage_out, 
 		    __u32 *datalen, __u32 *cdatalen)
 {
-	int ret;
-
-	ret = zlib_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_ZLIB;
-	}
-#if 0 /* Disabled 23/9/1. With zlib it hardly ever gets a look in */
-	ret = dynrubin_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_DYNRUBIN;
-	}
-#endif
-#if 0 /* Disabled 26/2/1. Obsoleted by dynrubin */
-	ret = rubinmips_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_RUBINMIPS;
-	}
-#endif
-	/* rtime does manage to recompress already-compressed data */
-	ret = rtime_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_RTIME;
-	}
-#if 0
-	/* We don't need to copy. Let the caller special-case the COMPR_NONE case. */
-	/* If we get here, no compression is going to work */
-	/* But we might want to use the fragmentation part -- Arjan */
-	memcpy(cpage_out,data_in,min(*datalen,*cdatalen));
-	if (*datalen > *cdatalen)
-		*datalen = *cdatalen;
-#endif		
 	return JFFS2_COMPR_NONE; /* We failed to compress */
 
 }

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com