From ea5715a73506eb929e43b66eb3b87c94e2b44ab4 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 30 Jun 2019 16:28:01 -0400 Subject: Merge with 1f431b384d bcachefs: Refactor trans_(get|update)_key --- fs/bcachefs/compress.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'fs/bcachefs/compress.c') diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c index 6379905bad7b..a7264d802ed7 100644 --- a/fs/bcachefs/compress.c +++ b/fs/bcachefs/compress.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "bcachefs.h" #include "checksum.h" #include "compress.h" @@ -5,7 +6,6 @@ #include "io.h" #include "super-io.h" -#include "lz4.h" #include #include #include @@ -159,11 +159,6 @@ static int __bio_uncompress(struct bch_fs *c, struct bio *src, switch (crc.compression_type) { case BCH_COMPRESSION_LZ4_OLD: - ret = bch2_lz4_decompress(src_data.b, &src_len, - dst_data, dst_len); - if (ret) - goto err; - break; case BCH_COMPRESSION_LZ4: ret = LZ4_decompress_safe_partial(src_data.b, dst_data, src_len, dst_len, dst_len); @@ -601,11 +596,13 @@ have_compressed: goto out; } - ret = mempool_init_kmalloc_pool( - &c->decompress_workspace, - 1, decompress_workspace_size); - if (ret) - goto out; + if (!mempool_initialized(&c->decompress_workspace)) { + ret = mempool_init_kmalloc_pool( + &c->decompress_workspace, + 1, decompress_workspace_size); + if (ret) + goto out; + } out: pr_verbose_init(c->opts, "ret %i", ret); return ret; -- cgit v1.2.3