summaryrefslogtreecommitdiffstats
path: root/testing/zfs-grsec/linux-3.11-lz4-compat.patch
blob: 88d415e885e0136efc480d08f86c55711e530b2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From b3c49d3df82466646bde9beebce7bbf0b3c41853 Mon Sep 17 00:00:00 2001
From: Richard Yao <ryao@gentoo.org>
Date: Sat, 5 Oct 2013 17:55:24 -0400
Subject: [PATCH] Linux 3.11 compat: Rename LZ4 symbols

Linus Torvalds merged LZ4 into Linux 3.11. This causes a conflict
whenever CONFIG_LZ4_DECOMPRESS=y or CONFIG_LZ4_COMPRESS=y are set in the
kernel's .config. We rename the symbols to avoid the conflict.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1789
---
 include/sys/zio_compress.h | 4 ++--
 module/zfs/lz4.c           | 4 ++--
 module/zfs/zio_compress.c  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/sys/zio_compress.h b/include/sys/zio_compress.h
index bd051f1..e4b565d 100644
--- a/include/sys/zio_compress.h
+++ b/include/sys/zio_compress.h
@@ -74,9 +74,9 @@ extern size_t zle_compress(void *src, void *dst, size_t s_len, size_t d_len,
     int level);
 extern int zle_decompress(void *src, void *dst, size_t s_len, size_t d_len,
     int level);
-extern size_t lz4_compress(void *src, void *dst, size_t s_len, size_t d_len,
+extern size_t lz4_compress_zfs(void *src, void *dst, size_t s_len, size_t d_len,
     int level);
-extern int lz4_decompress(void *src, void *dst, size_t s_len, size_t d_len,
+extern int lz4_decompress_zfs(void *src, void *dst, size_t s_len, size_t d_len,
     int level);
 
 /*
diff --git a/module/zfs/lz4.c b/module/zfs/lz4.c
index 8afaad1..ae5d5a2 100644
--- a/module/zfs/lz4.c
+++ b/module/zfs/lz4.c
@@ -47,7 +47,7 @@ static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest,
 
 /*ARGSUSED*/
 size_t
-lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
+lz4_compress_zfs(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
 {
 	uint32_t bufsiz;
 	char *dest = d_start;
@@ -74,7 +74,7 @@ static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest,
 
 /*ARGSUSED*/
 int
-lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
+lz4_decompress_zfs(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
 {
 	const char *src = s_start;
 	uint32_t bufsiz = BE_IN32(src);
diff --git a/module/zfs/zio_compress.c b/module/zfs/zio_compress.c
index 1dc780d..5864d5c 100644
--- a/module/zfs/zio_compress.c
+++ b/module/zfs/zio_compress.c
@@ -53,7 +53,7 @@
 	{gzip_compress,		gzip_decompress,	8,	"gzip-8"},
 	{gzip_compress,		gzip_decompress,	9,	"gzip-9"},
 	{zle_compress,		zle_decompress,		64,	"zle"},
-	{lz4_compress,		lz4_decompress,		0,	"lz4"},
+	{lz4_compress_zfs,	lz4_decompress_zfs,	0,	"lz4"},
 };
 
 enum zio_compress
-- 
1.8.5.1