diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-01 01:45:15 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-08 02:34:33 -0900 |
commit | 06b73dbd7ffc0296b2ecea8d3bc55bfeb72d7f2a (patch) | |
tree | 1ba37985a18eb2d9a9616ee160c82339e23e2160 /libbcache/compress.c | |
parent | 171ee48e57be78f4e95954c99851553fa523bf91 (diff) |
cmd_migratedisk-format-changes
Diffstat (limited to 'libbcache/compress.c')
-rw-r--r-- | libbcache/compress.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libbcache/compress.c b/libbcache/compress.c index f81a814..89da31e 100644 --- a/libbcache/compress.c +++ b/libbcache/compress.c @@ -434,10 +434,10 @@ int bch_check_set_has_compressed_data(struct cache_set *c, break; } - return bch_compress_init(c); + return bch_fs_compress_init(c); } -void bch_compress_free(struct cache_set *c) +void bch_fs_compress_exit(struct cache_set *c) { vfree(c->zlib_workspace); mempool_exit(&c->lz4_workspace_pool); @@ -450,15 +450,11 @@ void bch_compress_free(struct cache_set *c) max_t(size_t, zlib_inflate_workspacesize(), \ zlib_deflate_workspacesize(MAX_WBITS, DEF_MEM_LEVEL)) -int bch_compress_init(struct cache_set *c) +int bch_fs_compress_init(struct cache_set *c) { unsigned order = get_order(BCH_ENCODED_EXTENT_MAX << 9); int ret, cpu; - if (!bch_sb_test_feature(c->disk_sb, BCH_FEATURE_LZ4) && - !bch_sb_test_feature(c->disk_sb, BCH_FEATURE_GZIP)) - return 0; - if (!c->bio_decompress_worker) { c->bio_decompress_worker = alloc_percpu(*c->bio_decompress_worker); if (!c->bio_decompress_worker) @@ -474,6 +470,10 @@ int bch_compress_init(struct cache_set *c) } } + if (!bch_sb_test_feature(c->disk_sb, BCH_FEATURE_LZ4) && + !bch_sb_test_feature(c->disk_sb, BCH_FEATURE_GZIP)) + return 0; + if (!mempool_initialized(&c->compression_bounce[READ])) { ret = mempool_init_page_pool(&c->compression_bounce[READ], 1, order); |