[btrfs] Update patch to use ZSTD_init{C,D}Stream()

dev
Nick Terrell 2017-05-02 13:41:57 -07:00
parent 7aada3ca44
commit 79a85e1371
2 changed files with 13 additions and 13 deletions

View File

@ -193,7 +193,7 @@ index 1f157fb..b0dec90 100644
BTRFS_FEAT_ATTR_PTR(raid56), BTRFS_FEAT_ATTR_PTR(raid56),
diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c diff --git a/fs/btrfs/zstd.c b/fs/btrfs/zstd.c
new file mode 100644 new file mode 100644
index 0000000..b7f319e index 0000000..010548c
--- /dev/null --- /dev/null
+++ b/fs/btrfs/zstd.c +++ b/fs/btrfs/zstd.c
@@ -0,0 +1,415 @@ @@ -0,0 +1,415 @@
@ -291,10 +291,10 @@ index 0000000..b7f319e
+ *total_in = 0; + *total_in = 0;
+ +
+ /* Initialize the stream */ + /* Initialize the stream */
+ stream = ZSTD_createCStream(params, len, workspace->mem, + stream = ZSTD_initCStream(params, len, workspace->mem,
+ workspace->size); + workspace->size);
+ if (!stream) { + if (!stream) {
+ pr_warn("BTRFS: ZSTD_createStream failed\n"); + pr_warn("BTRFS: ZSTD_initStream failed\n");
+ ret = -EIO; + ret = -EIO;
+ goto out; + goto out;
+ } + }
@ -458,10 +458,10 @@ index 0000000..b7f319e
+ ZSTD_inBuffer in_buf = { NULL, 0, 0 }; + ZSTD_inBuffer in_buf = { NULL, 0, 0 };
+ ZSTD_outBuffer out_buf = { NULL, 0, 0 }; + ZSTD_outBuffer out_buf = { NULL, 0, 0 };
+ +
+ stream = ZSTD_createDStream( + stream = ZSTD_initDStream(
+ ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size); + ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size);
+ if (!stream) { + if (!stream) {
+ pr_debug("BTRFS: ZSTD_createDStream failed\n"); + pr_debug("BTRFS: ZSTD_initDStream failed\n");
+ ret = -EIO; + ret = -EIO;
+ goto done; + goto done;
+ } + }
@ -536,10 +536,10 @@ index 0000000..b7f319e
+ unsigned long pg_offset = 0; + unsigned long pg_offset = 0;
+ char *kaddr; + char *kaddr;
+ +
+ stream = ZSTD_createDStream( + stream = ZSTD_initDStream(
+ ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size); + ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size);
+ if (!stream) { + if (!stream) {
+ pr_warn("BTRFS: ZSTD_createDStream failed\n"); + pr_warn("BTRFS: ZSTD_initDStream failed\n");
+ ret = -EIO; + ret = -EIO;
+ goto finish; + goto finish;
+ } + }

View File

@ -92,10 +92,10 @@ static int zstd_compress_pages(struct list_head *ws,
*total_in = 0; *total_in = 0;
/* Initialize the stream */ /* Initialize the stream */
stream = ZSTD_createCStream(params, len, workspace->mem, stream = ZSTD_initCStream(params, len, workspace->mem,
workspace->size); workspace->size);
if (!stream) { if (!stream) {
pr_warn("BTRFS: ZSTD_createStream failed\n"); pr_warn("BTRFS: ZSTD_initStream failed\n");
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
@ -259,10 +259,10 @@ static int zstd_decompress_bio(struct list_head *ws, struct page **pages_in,
ZSTD_inBuffer in_buf = { NULL, 0, 0 }; ZSTD_inBuffer in_buf = { NULL, 0, 0 };
ZSTD_outBuffer out_buf = { NULL, 0, 0 }; ZSTD_outBuffer out_buf = { NULL, 0, 0 };
stream = ZSTD_createDStream( stream = ZSTD_initDStream(
ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size); ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size);
if (!stream) { if (!stream) {
pr_debug("BTRFS: ZSTD_createDStream failed\n"); pr_debug("BTRFS: ZSTD_initDStream failed\n");
ret = -EIO; ret = -EIO;
goto done; goto done;
} }
@ -337,10 +337,10 @@ static int zstd_decompress(struct list_head *ws, unsigned char *data_in,
unsigned long pg_offset = 0; unsigned long pg_offset = 0;
char *kaddr; char *kaddr;
stream = ZSTD_createDStream( stream = ZSTD_initDStream(
ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size); ZSTD_BTRFS_MAX_INPUT, workspace->mem, workspace->size);
if (!stream) { if (!stream) {
pr_warn("BTRFS: ZSTD_createDStream failed\n"); pr_warn("BTRFS: ZSTD_initDStream failed\n");
ret = -EIO; ret = -EIO;
goto finish; goto finish;
} }