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: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Родитель
00032d38ea
Коммит
5cdc84bfde
|
@ -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,
|
||||
size_t size, struct bio *bio,
|
||||
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);
|
||||
int btrfs_readpage(struct file *file, struct page *page);
|
||||
void btrfs_evict_inode(struct inode *inode);
|
||||
|
|
|
@ -4528,7 +4528,6 @@ static const struct extent_io_ops btree_extent_io_ops = {
|
|||
.submit_bio_hook = btree_submit_bio_hook,
|
||||
.readpage_end_io_hook = btree_readpage_end_io_hook,
|
||||
.readpage_io_failed_hook = btree_io_failed_hook,
|
||||
.set_range_writeback = btrfs_set_range_writeback,
|
||||
|
||||
/* optional callbacks */
|
||||
};
|
||||
|
|
|
@ -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
|
||||
* return it. tree->lock must be held. NULL will returned if
|
||||
* nothing was found after 'start'
|
||||
|
@ -3416,7 +3408,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
|
|||
continue;
|
||||
}
|
||||
|
||||
set_range_writeback(tree, cur, cur + iosize - 1);
|
||||
btrfs_set_range_writeback(tree, cur, cur + iosize - 1);
|
||||
if (!PageWriteback(page)) {
|
||||
btrfs_err(BTRFS_I(inode)->root->fs_info,
|
||||
"page %lu not writeback, cur %llu end %llu",
|
||||
|
|
|
@ -102,7 +102,6 @@ struct extent_io_ops {
|
|||
struct page *page, u64 start, u64 end,
|
||||
int 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
|
||||
|
|
|
@ -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 end_index = end >> PAGE_SHIFT;
|
||||
struct page *page;
|
||||
|
@ -10546,7 +10546,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = {
|
|||
.submit_bio_hook = btrfs_submit_bio_hook,
|
||||
.readpage_end_io_hook = btrfs_readpage_end_io_hook,
|
||||
.readpage_io_failed_hook = btrfs_readpage_io_failed_hook,
|
||||
.set_range_writeback = btrfs_set_range_writeback,
|
||||
|
||||
/* optional callbacks */
|
||||
.fill_delalloc = run_delalloc_range,
|
||||
|
|
Загрузка…
Ссылка в новой задаче