public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael-Luke Jones <mike.luke.jones@gmail.com>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	dwmw2@infradead.org
Subject: [-mm] Move zlib compression library to common directory [TAKE TWO]
Date: Tue, 29 May 2007 17:31:05 +0100	[thread overview]
Message-ID: <465C5549.4050101@gmail.com> (raw)
In-Reply-To: <465C3973.3090303@gmail.com>

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



[-- Attachment #2: zlib-move.patch --]
[-- Type: text/plain, Size: 7037 bytes --]

This patch moves the zlib compression and decompression code
to a common directory. The zutil.h header, which is not meant
to be public, is moved from include/linux/ to lib/zlib/.

In addition, the PRESET_DICT definition from zutil.h, used by
fs/jffs2/compr_zlib.c is moved to the 'true' public zlib
header include/linux/zlib.h.

Conditional compile of only inflate or deflate code is
preserved by this patch. With a bit of luck, this version
won't be whitespace-damaged. Grumble.

Signed-off-by: Michael-Luke Jones <mike.luke.jones@gmail.com>

diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c
index 2b87fcc..e2cc6c7 100644
--- a/fs/jffs2/compr_zlib.c
+++ b/fs/jffs2/compr_zlib.c
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/zlib.h>
-#include <linux/zutil.h>
 #include "nodelist.h"
 #include "compr.h"
 
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 9e3192a..e9d32c5 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -177,6 +177,9 @@ typedef z_stream *z_streamp;
 #define Z_DEFLATED   8
 /* The deflate compression method (the only one supported in this version) */
 
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+/* Required by fs/jffs2/compr_zlib.c */
+
                         /* basic functions */
 
 extern int zlib_deflate_workspacesize (void);
diff --git a/lib/Makefile b/lib/Makefile
index c8c8e20..42c3903 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -46,8 +46,8 @@ obj-$(CONFIG_CRC32)	+= crc32.o
 obj-$(CONFIG_LIBCRC32C)	+= libcrc32c.o
 obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
 
-obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
-obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/
+obj-$(CONFIG_ZLIB_INFLATE) += zlib/
+obj-$(CONFIG_ZLIB_DEFLATE) += zlib/
 obj-$(CONFIG_REED_SOLOMON) += reed_solomon/
 
 obj-$(CONFIG_TEXTSEARCH) += textsearch.o
diff --git a/lib/zlib_inflate/Makefile b/lib/zlib/Makefile
similarity index 71%
rename from lib/zlib_inflate/Makefile
rename to lib/zlib/Makefile
index bf06548..528d903 100644
--- a/lib/zlib_inflate/Makefile
+++ b/lib/zlib/Makefile
@@ -2,8 +2,8 @@
 # This is a modified version of zlib, which does all memory
 # allocation ahead of time.
 #
-# This is only the decompression, see zlib_deflate for the
-# the compression
+# The compression (deflate) and decompression (inflate) code
+# is present in this folder.
 #
 # Decompression needs to be serialized for each memory
 # allocation.
@@ -17,3 +17,7 @@ obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate.o
 
 zlib_inflate-objs := inffast.o inflate.o \
 		     inftrees.o inflate_syms.o
+
+obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate.o
+
+zlib_deflate-objs := deflate.o deftree.o deflate_syms.o
diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib/deflate.c
similarity index 100%
rename from lib/zlib_deflate/deflate.c
rename to lib/zlib/deflate.c
index c3e4a2b..1137780 100644
--- a/lib/zlib_deflate/deflate.c
+++ b/lib/zlib/deflate.c
@@ -49,10 +49,9 @@
  */
 
 #include <linux/module.h>
-#include <linux/zutil.h>
+#include "zutil.h"
 #include "defutil.h"
 
-
 /* ===========================================================================
  *  Function prototypes.
  */
diff --git a/lib/zlib_deflate/deflate_syms.c b/lib/zlib/deflate_syms.c
similarity index 100%
rename from lib/zlib_deflate/deflate_syms.c
rename to lib/zlib/deflate_syms.c
diff --git a/lib/zlib_deflate/deftree.c b/lib/zlib/deftree.c
similarity index 100%
rename from lib/zlib_deflate/deftree.c
rename to lib/zlib/deftree.c
index ddf3482..d5ce87d 100644
--- a/lib/zlib_deflate/deftree.c
+++ b/lib/zlib/deftree.c
@@ -34,7 +34,7 @@
 
 /* #include "deflate.h" */
 
-#include <linux/zutil.h>
+#include "zutil.h"
 #include "defutil.h"
 
 #ifdef DEBUG_ZLIB
diff --git a/lib/zlib_deflate/defutil.h b/lib/zlib/defutil.h
similarity index 100%
rename from lib/zlib_deflate/defutil.h
rename to lib/zlib/defutil.h
diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib/inffast.c
similarity index 100%
rename from lib/zlib_inflate/inffast.c
rename to lib/zlib/inffast.c
index d84560c..50d3de1 100644
--- a/lib/zlib_inflate/inffast.c
+++ b/lib/zlib/inffast.c
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-#include <linux/zutil.h>
+#include "zutil.h"
 #include "inftrees.h"
 #include "inflate.h"
 #include "inffast.h"
diff --git a/lib/zlib_inflate/inffast.h b/lib/zlib/inffast.h
similarity index 100%
rename from lib/zlib_inflate/inffast.h
rename to lib/zlib/inffast.h
diff --git a/lib/zlib_inflate/inffixed.h b/lib/zlib/inffixed.h
similarity index 100%
rename from lib/zlib_inflate/inffixed.h
rename to lib/zlib/inffixed.h
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib/inflate.c
similarity index 100%
rename from lib/zlib_inflate/inflate.c
rename to lib/zlib/inflate.c
index 7e1e311..ba58871 100644
--- a/lib/zlib_inflate/inflate.c
+++ b/lib/zlib/inflate.c
@@ -9,7 +9,7 @@
  *
  */
 
-#include <linux/zutil.h>
+#include "zutil.h"
 #include "inftrees.h"
 #include "inflate.h"
 #include "inffast.h"
diff --git a/lib/zlib_inflate/inflate.h b/lib/zlib/inflate.h
similarity index 100%
rename from lib/zlib_inflate/inflate.h
rename to lib/zlib/inflate.h
diff --git a/lib/zlib_inflate/inflate_syms.c b/lib/zlib/inflate_syms.c
similarity index 100%
rename from lib/zlib_inflate/inflate_syms.c
rename to lib/zlib/inflate_syms.c
diff --git a/lib/zlib_inflate/inftrees.c b/lib/zlib/inftrees.c
similarity index 100%
rename from lib/zlib_inflate/inftrees.c
rename to lib/zlib/inftrees.c
index 3fe6ce5..faf6f75 100644
--- a/lib/zlib_inflate/inftrees.c
+++ b/lib/zlib/inftrees.c
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-#include <linux/zutil.h>
+#include "zutil.h"
 #include "inftrees.h"
 
 #define MAXBITS 15
diff --git a/lib/zlib_inflate/inftrees.h b/lib/zlib/inftrees.h
similarity index 100%
rename from lib/zlib_inflate/inftrees.h
rename to lib/zlib/inftrees.h
diff --git a/lib/zlib_inflate/infutil.h b/lib/zlib/infutil.h
similarity index 100%
rename from lib/zlib_inflate/infutil.h
rename to lib/zlib/infutil.h
diff --git a/include/linux/zutil.h b/lib/zlib/zutil.h
similarity index 98%
rename from include/linux/zutil.h
rename to lib/zlib/zutil.h
index 6adfa9a..0467c8c 100644
--- a/include/linux/zutil.h
+++ b/lib/zlib/zutil.h
@@ -32,7 +32,7 @@ typedef unsigned long  ulg;
 #define MAX_MATCH  258
 /* The minimum and maximum match lengths */
 
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+/* PRESET_DICT #define moved to <linux/zlib.h> for JFFS2 */
 
         /* target dependencies */
 
diff --git a/lib/zlib_deflate/Makefile b/lib/zlib_deflate/Makefile
deleted file mode 100644
index 86275e3..0000000
--- a/lib/zlib_deflate/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# This is a modified version of zlib, which does all memory
-# allocation ahead of time.
-#
-# This is the compression code, see zlib_inflate for the
-# decompression code.
-#
-
-obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate.o
-
-zlib_deflate-objs := deflate.o deftree.o deflate_syms.o

  reply	other threads:[~2007-05-29 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-29 14:32 [-mm] Move zlib compression library to common directory Michael-Luke Jones
2007-05-29 16:31 ` Michael-Luke Jones [this message]
2007-05-30 17:47   ` [-mm] Move zlib compression library to common directory [TAKE TWO] Andrew Morton
2007-05-30 20:15     ` Michael-Luke Jones
2007-05-30 18:05   ` Satyam Sharma
2007-05-30 19:20     ` Michael-Luke Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=465C5549.4050101@gmail.com \
    --to=mike.luke.jones@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox