aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/lzo.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-02-14 19:45:05 +0100
committerDavid Sterba <dsterba@suse.com>2017-02-28 14:26:36 +0100
commite5d74902362f1a06ea3674042d09f1af178c0a20 (patch)
tree18b3bf38ac7e1d72923e423156f5e1843317f695 /fs/btrfs/lzo.c
parentbtrfs: use predefined limits for calculating maximum number of pages for compression (diff)
downloadlinux-dev-e5d74902362f1a06ea3674042d09f1af178c0a20.tar.xz
linux-dev-e5d74902362f1a06ea3674042d09f1af178c0a20.zip
btrfs: derive maximum output size in the compression implementation
The value of max_out can be calculated from the parameters passed to the compressors, which is number of pages and the page size, and we don't have to needlessly pass it around. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/lzo.c')
-rw-r--r--fs/btrfs/lzo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index 0baf978fbcaf..f48c8c14dc14 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -90,8 +90,7 @@ static int lzo_compress_pages(struct list_head *ws,
struct page **pages,
unsigned long *out_pages,
unsigned long *total_in,
- unsigned long *total_out,
- unsigned long max_out)
+ unsigned long *total_out)
{
struct workspace *workspace = list_entry(ws, struct workspace, list);
int ret = 0;
@@ -103,6 +102,7 @@ static int lzo_compress_pages(struct list_head *ws,
unsigned long bytes_left;
unsigned long len = *total_out;
unsigned long nr_dest_pages = *out_pages;
+ const unsigned long max_out = nr_dest_pages * PAGE_SIZE;
size_t in_len;
size_t out_len;
char *buf;