Commit cecc8d90 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Move free_pages_out label in inline extent handling branch in compress_file_range

This label is only executed if compress_file_range fails to create an
inline extent. So move its code in the semantically related inline
extent handling branch. No functional changes.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ac3e9933
...@@ -622,7 +622,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -622,7 +622,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
PAGE_SET_WRITEBACK | PAGE_SET_WRITEBACK |
page_error_op | page_error_op |
PAGE_END_WRITEBACK); PAGE_END_WRITEBACK);
goto free_pages_out;
for (i = 0; i < nr_pages; i++) {
WARN_ON(pages[i]->mapping);
put_page(pages[i]);
}
kfree(pages);
return 0;
} }
} }
...@@ -700,15 +707,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk) ...@@ -700,15 +707,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
compressed_extents++; compressed_extents++;
return compressed_extents; return compressed_extents;
free_pages_out:
for (i = 0; i < nr_pages; i++) {
WARN_ON(pages[i]->mapping);
put_page(pages[i]);
}
kfree(pages);
return 0;
} }
static void free_async_extent_pages(struct async_extent *async_extent) static void free_async_extent_pages(struct async_extent *async_extent)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment