Commit 5cdc84bf authored by David Sterba's avatar David Sterba

btrfs: drop extent_io_ops::set_range_writeback callback

The data and metadata callback implementation both use the same
function. We can remove the call indirection and intermediate helper
completely.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 00032d38
...@@ -3172,7 +3172,7 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, ...@@ -3172,7 +3172,7 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
int btrfs_merge_bio_hook(struct page *page, unsigned long offset, int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
size_t size, struct bio *bio, size_t size, struct bio *bio,
unsigned long bio_flags); unsigned long bio_flags);
void btrfs_set_range_writeback(void *private_data, u64 start, u64 end); void btrfs_set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end);
vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf); vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf);
int btrfs_readpage(struct file *file, struct page *page); int btrfs_readpage(struct file *file, struct page *page);
void btrfs_evict_inode(struct inode *inode); void btrfs_evict_inode(struct inode *inode);
......
...@@ -4528,7 +4528,6 @@ static const struct extent_io_ops btree_extent_io_ops = { ...@@ -4528,7 +4528,6 @@ static const struct extent_io_ops btree_extent_io_ops = {
.submit_bio_hook = btree_submit_bio_hook, .submit_bio_hook = btree_submit_bio_hook,
.readpage_end_io_hook = btree_readpage_end_io_hook, .readpage_end_io_hook = btree_readpage_end_io_hook,
.readpage_io_failed_hook = btree_io_failed_hook, .readpage_io_failed_hook = btree_io_failed_hook,
.set_range_writeback = btrfs_set_range_writeback,
/* optional callbacks */ /* optional callbacks */
}; };
...@@ -1380,14 +1380,6 @@ void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end) ...@@ -1380,14 +1380,6 @@ void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
} }
} }
/*
* helper function to set both pages and extents in the tree writeback
*/
static void set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end)
{
tree->ops->set_range_writeback(tree->private_data, start, end);
}
/* find the first state struct with 'bits' set after 'start', and /* find the first state struct with 'bits' set after 'start', and
* return it. tree->lock must be held. NULL will returned if * return it. tree->lock must be held. NULL will returned if
* nothing was found after 'start' * nothing was found after 'start'
...@@ -3416,7 +3408,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode, ...@@ -3416,7 +3408,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
continue; continue;
} }
set_range_writeback(tree, cur, cur + iosize - 1); btrfs_set_range_writeback(tree, cur, cur + iosize - 1);
if (!PageWriteback(page)) { if (!PageWriteback(page)) {
btrfs_err(BTRFS_I(inode)->root->fs_info, btrfs_err(BTRFS_I(inode)->root->fs_info,
"page %lu not writeback, cur %llu end %llu", "page %lu not writeback, cur %llu end %llu",
......
...@@ -102,7 +102,6 @@ struct extent_io_ops { ...@@ -102,7 +102,6 @@ struct extent_io_ops {
struct page *page, u64 start, u64 end, struct page *page, u64 start, u64 end,
int mirror); int mirror);
int (*readpage_io_failed_hook)(struct page *page, int failed_mirror); int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
void (*set_range_writeback)(void *private_data, u64 start, u64 end);
/* /*
* Optional hooks, called if the pointer is not NULL * Optional hooks, called if the pointer is not NULL
......
...@@ -10487,9 +10487,9 @@ static void btrfs_check_extent_io_range(void *private_data, const char *caller, ...@@ -10487,9 +10487,9 @@ static void btrfs_check_extent_io_range(void *private_data, const char *caller,
} }
} }
void btrfs_set_range_writeback(void *private_data, u64 start, u64 end) void btrfs_set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end)
{ {
struct inode *inode = private_data; struct inode *inode = tree->private_data;
unsigned long index = start >> PAGE_SHIFT; unsigned long index = start >> PAGE_SHIFT;
unsigned long end_index = end >> PAGE_SHIFT; unsigned long end_index = end >> PAGE_SHIFT;
struct page *page; struct page *page;
...@@ -10546,7 +10546,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = { ...@@ -10546,7 +10546,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = {
.submit_bio_hook = btrfs_submit_bio_hook, .submit_bio_hook = btrfs_submit_bio_hook,
.readpage_end_io_hook = btrfs_readpage_end_io_hook, .readpage_end_io_hook = btrfs_readpage_end_io_hook,
.readpage_io_failed_hook = btrfs_readpage_io_failed_hook, .readpage_io_failed_hook = btrfs_readpage_io_failed_hook,
.set_range_writeback = btrfs_set_range_writeback,
/* optional callbacks */ /* optional callbacks */
.fill_delalloc = run_delalloc_range, .fill_delalloc = run_delalloc_range,
......
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