Merge branch 'fortglx/39/tip/timers/rtc' of git://git.linaro.org/people/jstultz/linux...
[pandora-kernel.git] / fs / squashfs / zlib_wrapper.c
index 4661ae2..517688b 100644 (file)
 #include <linux/buffer_head.h>
 #include <linux/slab.h>
 #include <linux/zlib.h>
+#include <linux/vmalloc.h>
 
 #include "squashfs_fs.h"
 #include "squashfs_fs_sb.h"
 #include "squashfs.h"
 #include "decompressor.h"
 
-static void *zlib_init(struct squashfs_sb_info *dummy)
+static void *zlib_init(struct squashfs_sb_info *dummy, void *buff, int len)
 {
        z_stream *stream = kmalloc(sizeof(z_stream), GFP_KERNEL);
        if (stream == NULL)
                goto failed;
-       stream->workspace = kmalloc(zlib_inflate_workspacesize(),
-               GFP_KERNEL);
+       stream->workspace = vmalloc(zlib_inflate_workspacesize());
        if (stream->workspace == NULL)
                goto failed;
 
@@ -47,7 +47,7 @@ static void *zlib_init(struct squashfs_sb_info *dummy)
 failed:
        ERROR("Failed to allocate zlib workspace\n");
        kfree(stream);
-       return NULL;
+       return ERR_PTR(-ENOMEM);
 }
 
 
@@ -56,7 +56,7 @@ static void zlib_free(void *strm)
        z_stream *stream = strm;
 
        if (stream)
-               kfree(stream->workspace);
+               vfree(stream->workspace);
        kfree(stream);
 }