diff options
author | Anand Jain <anand.jain@oracle.com> | 2017-05-26 10:44:59 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 19:26:00 +0300 |
commit | e1ddce71d6cab53c28353c081af7692169417d1b (patch) | |
tree | 35c8c9bde02213d854999783175de221237b5133 /fs/btrfs/zlib.c | |
parent | 8140dc30a432694d851c1b24b8eda95acd494e16 (diff) | |
download | linux-e1ddce71d6cab53c28353c081af7692169417d1b.tar.xz |
btrfs: reduce arguments for decompress_bio ops
struct compressed_bio pointer can be used instead.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/zlib.c')
-rw-r--r-- | fs/btrfs/zlib.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index 135b10823c6d..d5446e18bb59 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c @@ -30,6 +30,7 @@ #include <linux/sched.h> #include <linux/pagemap.h> #include <linux/bio.h> +#include <linux/refcount.h> #include "compression.h" struct workspace { @@ -211,10 +212,7 @@ out: return ret; } -static int zlib_decompress_bio(struct list_head *ws, struct page **pages_in, - u64 disk_start, - struct bio *orig_bio, - size_t srclen) +static int zlib_decompress_bio(struct list_head *ws, struct compressed_bio *cb) { struct workspace *workspace = list_entry(ws, struct workspace, list); int ret = 0, ret2; @@ -222,8 +220,12 @@ static int zlib_decompress_bio(struct list_head *ws, struct page **pages_in, char *data_in; size_t total_out = 0; unsigned long page_in_index = 0; + size_t srclen = cb->compressed_len; unsigned long total_pages_in = DIV_ROUND_UP(srclen, PAGE_SIZE); unsigned long buf_start; + struct page **pages_in = cb->compressed_pages; + u64 disk_start = cb->start; + struct bio *orig_bio = cb->orig_bio; data_in = kmap(pages_in[page_in_index]); workspace->strm.next_in = data_in; |