]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/jffs2/compr_zlib.c
Merge by hand (conflicts between pending drivers and kfree cleanups)
[karo-tx-linux.git] / fs / jffs2 / compr_zlib.c
index 9f9932c22adbdd675c22b6545595d749797977c2..4db8be8e90cc09dea0f71d09d55048d612bbb17a 100644 (file)
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: compr_zlib.c,v 1.29 2004/11/16 20:36:11 dwmw2 Exp $
+ * $Id: compr_zlib.c,v 1.32 2005/11/07 11:14:38 gleixner Exp $
  *
  */
 
 
 #include <linux/config.h>
 #include <linux/kernel.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/zlib.h>
 #include <linux/zutil.h>
-#include <asm/semaphore.h>
 #include "nodelist.h"
 #include "compr.h"
 
-       /* Plan: call deflate() with avail_in == *sourcelen, 
-               avail_out = *dstlen - 12 and flush == Z_FINISH. 
+       /* Plan: call deflate() with avail_in == *sourcelen,
+               avail_out = *dstlen - 12 and flush == Z_FINISH.
                If it doesn't manage to finish, call it again with
                avail_in == 0 and avail_out set to the remaining 12
-               bytes for it to clean up. 
+               bytes for it to clean up.
           Q: Is 12 bytes sufficient?
        */
 #define STREAM_END_SPACE 12
@@ -69,8 +69,10 @@ static void free_workspaces(void)
 #define free_workspaces() do { } while(0)
 #endif /* __KERNEL__ */
 
-int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out, 
-                  uint32_t *sourcelen, uint32_t *dstlen, void *model)
+static int jffs2_zlib_compress(unsigned char *data_in,
+                              unsigned char *cpage_out,
+                              uint32_t *sourcelen, uint32_t *dstlen,
+                              void *model)
 {
        int ret;
 
@@ -87,7 +89,7 @@ int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out,
 
        def_strm.next_in = data_in;
        def_strm.total_in = 0;
-       
+
        def_strm.next_out = cpage_out;
        def_strm.total_out = 0;
 
@@ -97,7 +99,7 @@ int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out,
                D1(printk(KERN_DEBUG "calling deflate with avail_in %d, avail_out %d\n",
                          def_strm.avail_in, def_strm.avail_out));
                ret = zlib_deflate(&def_strm, Z_PARTIAL_FLUSH);
-               D1(printk(KERN_DEBUG "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n", 
+               D1(printk(KERN_DEBUG "deflate returned with avail_in %d, avail_out %d, total_in %ld, total_out %ld\n",
                          def_strm.avail_in, def_strm.avail_out, def_strm.total_in, def_strm.total_out));
                if (ret != Z_OK) {
                        D1(printk(KERN_DEBUG "deflate in loop returned %d\n", ret));
@@ -135,8 +137,10 @@ int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out,
        return ret;
 }
 
-int jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
-                     uint32_t srclen, uint32_t destlen, void *model)
+static int jffs2_zlib_decompress(unsigned char *data_in,
+                                unsigned char *cpage_out,
+                                uint32_t srclen, uint32_t destlen,
+                                void *model)
 {
        int ret;
        int wbits = MAX_WBITS;
@@ -146,7 +150,7 @@ int jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
        inf_strm.next_in = data_in;
        inf_strm.avail_in = srclen;
        inf_strm.total_in = 0;
-       
+
        inf_strm.next_out = cpage_out;
        inf_strm.avail_out = destlen;
        inf_strm.total_out = 0;