Skip to content

Commit cecc8d9

Browse files
lorddoskiaskdave
authored andcommitted
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: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent ac3e993 commit cecc8d9

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

fs/btrfs/inode.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,14 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
622622
PAGE_SET_WRITEBACK |
623623
page_error_op |
624624
PAGE_END_WRITEBACK);
625-
goto free_pages_out;
625+
626+
for (i = 0; i < nr_pages; i++) {
627+
WARN_ON(pages[i]->mapping);
628+
put_page(pages[i]);
629+
}
630+
kfree(pages);
631+
632+
return 0;
626633
}
627634
}
628635

@@ -700,15 +707,6 @@ static noinline int compress_file_range(struct async_chunk *async_chunk)
700707
compressed_extents++;
701708

702709
return compressed_extents;
703-
704-
free_pages_out:
705-
for (i = 0; i < nr_pages; i++) {
706-
WARN_ON(pages[i]->mapping);
707-
put_page(pages[i]);
708-
}
709-
kfree(pages);
710-
711-
return 0;
712710
}
713711

714712
static void free_async_extent_pages(struct async_extent *async_extent)

0 commit comments

Comments
 (0)