btrfs: merge nr_pages input and output parameter in compress_pages

The parameter saying how many pages can be allocated at maximum can be
merged with the output page counter, to save some stack space.  The
compression implementation will sink the parameter to a local variable
so everything works as before.

The nr_pages variables can also be simply merged in compress_file_range
into one.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba
2017-02-14 19:04:07 +01:00
parent 38c3146408
commit 4d3a800ebb
5 changed files with 11 additions and 15 deletions

View File

@@ -75,7 +75,6 @@ static int zlib_compress_pages(struct list_head *ws,
struct address_space *mapping,
u64 start,
struct page **pages,
unsigned long nr_dest_pages,
unsigned long *out_pages,
unsigned long *total_in,
unsigned long *total_out,
@@ -90,6 +89,7 @@ static int zlib_compress_pages(struct list_head *ws,
struct page *out_page = NULL;
unsigned long bytes_left;
unsigned long len = *total_out;
unsigned long nr_dest_pages = *out_pages;
*out_pages = 0;
*total_out = 0;