aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMister Oyster <oysterized@gmail.com>2017-09-25 20:22:44 +0200
committerMister Oyster <oysterized@gmail.com>2017-09-25 20:27:49 +0200
commitffba7d48339b437cdf1d12979b56ebc562ae6c2d (patch)
treecdfb647213c1d65ae381aa81ec76917a6cd2020c
parent56b31b8c5ade6986bfbb064e5127d1ac79e597fb (diff)
zram/zsmalloc: Squashed fixes zcomp lz4 header fix
fix zram drv h include fix build
-rw-r--r--drivers/block/zram/zcomp.c2
-rw-r--r--drivers/block/zram/zcomp.h68
-rw-r--r--drivers/block/zram/zcomp_lzo.h2
-rw-r--r--drivers/block/zram/zram_drv.c2
-rw-r--r--drivers/block/zram/zram_drv.h4
5 files changed, 6 insertions, 72 deletions
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index f1ff39a3d..6a7692281 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -14,7 +14,7 @@
#include <linux/wait.h>
#include <linux/sched.h>
-#include "zcomp.h"
+#include <linux/zcomp.h>
#include "zcomp_lzo.h"
#ifdef CONFIG_ZRAM_LZ4_COMPRESS
#include "zcomp_lz4.h"
diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h
deleted file mode 100644
index c59d1fca7..000000000
--- a/drivers/block/zram/zcomp.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2014 Sergey Senozhatsky.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#ifndef _ZCOMP_H_
-#define _ZCOMP_H_
-
-#include <linux/mutex.h>
-
-struct zcomp_strm {
- /* compression/decompression buffer */
- void *buffer;
- /*
- * The private data of the compression stream, only compression
- * stream backend can touch this (e.g. compression algorithm
- * working memory)
- */
- void *private;
- /* used in multi stream backend, protected by backend strm_lock */
- struct list_head list;
-};
-
-/* static compression backend */
-struct zcomp_backend {
- int (*compress)(const unsigned char *src, unsigned char *dst,
- size_t *dst_len, void *private);
-
- int (*decompress)(const unsigned char *src, size_t src_len,
- unsigned char *dst);
-
- void *(*create)(void);
- void (*destroy)(void *private);
-
- const char *name;
-};
-
-/* dynamic per-device compression frontend */
-struct zcomp {
- void *stream;
- struct zcomp_backend *backend;
-
- struct zcomp_strm *(*strm_find)(struct zcomp *comp);
- void (*strm_release)(struct zcomp *comp, struct zcomp_strm *zstrm);
- bool (*set_max_streams)(struct zcomp *comp, int num_strm);
- void (*destroy)(struct zcomp *comp);
-};
-
-ssize_t zcomp_available_show(const char *comp, char *buf);
-
-struct zcomp *zcomp_create(const char *comp, int max_strm);
-void zcomp_destroy(struct zcomp *comp);
-
-struct zcomp_strm *zcomp_strm_find(struct zcomp *comp);
-void zcomp_strm_release(struct zcomp *comp, struct zcomp_strm *zstrm);
-
-int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
- const unsigned char *src, size_t *dst_len);
-
-int zcomp_decompress(struct zcomp *comp, const unsigned char *src,
- size_t src_len, unsigned char *dst);
-
-bool zcomp_set_max_streams(struct zcomp *comp, int num_strm);
-#endif /* _ZCOMP_H_ */
diff --git a/drivers/block/zram/zcomp_lzo.h b/drivers/block/zram/zcomp_lzo.h
index 128c5807f..a1cdc9eb9 100644
--- a/drivers/block/zram/zcomp_lzo.h
+++ b/drivers/block/zram/zcomp_lzo.h
@@ -10,7 +10,7 @@
#ifndef _ZCOMP_LZO_H_
#define _ZCOMP_LZO_H_
-#include "zcomp.h"
+#include <linux/zcomp.h>
extern struct zcomp_backend zcomp_lzo;
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index f9605860f..562e46649 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -37,7 +37,7 @@
/* Globals */
static int zram_major;
-static struct zram *zram_devices;
+struct zram *zram_devices;
static const char *default_compressor = "lzo";
/* Module params (documentation at end) */
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 570c598f4..d79ddc316 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -18,7 +18,7 @@
#include <linux/spinlock.h>
#include <linux/zsmalloc.h>
-#include "zcomp.h"
+#include <linux/zcomp.h>
/*
* Some arbitrary value. This is just to catch
@@ -122,4 +122,6 @@ struct zram {
u64 disksize; /* bytes */
char compressor[10];
};
+
+extern struct zram *zram_devices;
#endif