]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: remove unnecessary parameter type from compression_decompress_bio
authorSu Yue <l@damenly.su>
Mon, 27 Dec 2021 10:18:39 +0000 (18:18 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:27 +0000 (14:18 +0100)
btrfs_decompress_bio, the only caller of compression_decompress_bio gets
type from @cb and passes it to compression_decompress_bio.
However, compression_decompress_bio can get compression type directly
from @cb.

So remove the parameter and access it through @cb.  No functional
change.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Su Yue <l@damenly.su>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c

index e776956d5bc9296b238ec16f34444129c0e74871..71e5b2e9a1ba822b51049ca466bfeeb505bc277c 100644 (file)
@@ -96,10 +96,10 @@ static int compression_compress_pages(int type, struct list_head *ws,
        }
 }
 
-static int compression_decompress_bio(int type, struct list_head *ws,
-               struct compressed_bio *cb)
+static int compression_decompress_bio(struct list_head *ws,
+                                     struct compressed_bio *cb)
 {
-       switch (type) {
+       switch (cb->compress_type) {
        case BTRFS_COMPRESS_ZLIB: return zlib_decompress_bio(ws, cb);
        case BTRFS_COMPRESS_LZO:  return lzo_decompress_bio(ws, cb);
        case BTRFS_COMPRESS_ZSTD: return zstd_decompress_bio(ws, cb);
@@ -1360,7 +1360,7 @@ static int btrfs_decompress_bio(struct compressed_bio *cb)
        int type = cb->compress_type;
 
        workspace = get_workspace(type, 0);
-       ret = compression_decompress_bio(type, workspace, cb);
+       ret = compression_decompress_bio(workspace, cb);
        put_workspace(type, workspace);
 
        return ret;