Skip to content

Commit

Permalink
btrfs: drop get_extent from extent_page_data
Browse files Browse the repository at this point in the history
Previous patches cleaned up all places where
extent_page_data::get_extent was set and it was btrfs_get_extent all the
time, so we can simply call that instead.

This also reduces size of extent_page_data by 8 bytes which has positive
effect on stack consumption on various functions on the write out path.

Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jan 22, 2018
1 parent deac642 commit 3c98c62
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ struct tree_entry {
struct extent_page_data {
struct bio *bio;
struct extent_io_tree *tree;
get_extent_t *get_extent;

/* tells writepage not to lock the state bits for this range
* it still does the unlocking
*/
Expand Down Expand Up @@ -3373,7 +3371,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
page_end, NULL, 1);
break;
}
em = epd->get_extent(BTRFS_I(inode), page, pg_offset, cur,
em = btrfs_get_extent(BTRFS_I(inode), page, pg_offset, cur,
end - cur + 1, 1);
if (IS_ERR_OR_NULL(em)) {
SetPageError(page);
Expand Down Expand Up @@ -4064,7 +4062,6 @@ int extent_write_full_page(struct extent_io_tree *tree, struct page *page,
struct extent_page_data epd = {
.bio = NULL,
.tree = tree,
.get_extent = btrfs_get_extent,
.extent_locked = 0,
.sync_io = wbc->sync_mode == WB_SYNC_ALL,
};
Expand All @@ -4087,7 +4084,6 @@ int extent_write_locked_range(struct extent_io_tree *tree, struct inode *inode,
struct extent_page_data epd = {
.bio = NULL,
.tree = tree,
.get_extent = btrfs_get_extent,
.extent_locked = 1,
.sync_io = mode == WB_SYNC_ALL,
};
Expand Down Expand Up @@ -4125,7 +4121,6 @@ int extent_writepages(struct extent_io_tree *tree,
struct extent_page_data epd = {
.bio = NULL,
.tree = tree,
.get_extent = btrfs_get_extent,
.extent_locked = 0,
.sync_io = wbc->sync_mode == WB_SYNC_ALL,
};
Expand Down

0 comments on commit 3c98c62

Please sign in to comment.