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

btrfs: Remove extent_io_ops::split_extent_hook callback

This is the counterpart to merge_extent_hook, similarly, it's used only
for data/freespace inodes so let's remove it, rename it and call it
directly where necessary. No functional changes.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
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 5c848198
...@@ -3156,6 +3156,8 @@ void btrfs_clear_delalloc_extent(struct inode *inode, ...@@ -3156,6 +3156,8 @@ void btrfs_clear_delalloc_extent(struct inode *inode,
struct extent_state *state, unsigned *bits); struct extent_state *state, unsigned *bits);
void btrfs_merge_delalloc_extent(struct inode *inode, struct extent_state *new, void btrfs_merge_delalloc_extent(struct inode *inode, struct extent_state *new,
struct extent_state *other); struct extent_state *other);
void btrfs_split_delalloc_extent(struct inode *inode,
struct extent_state *orig, u64 split);
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);
......
...@@ -445,13 +445,6 @@ static int insert_state(struct extent_io_tree *tree, ...@@ -445,13 +445,6 @@ static int insert_state(struct extent_io_tree *tree,
return 0; return 0;
} }
static void split_cb(struct extent_io_tree *tree, struct extent_state *orig,
u64 split)
{
if (tree->ops && tree->ops->split_extent_hook)
tree->ops->split_extent_hook(tree->private_data, orig, split);
}
/* /*
* split a given extent state struct in two, inserting the preallocated * split a given extent state struct in two, inserting the preallocated
* struct 'prealloc' as the newly created second half. 'split' indicates an * struct 'prealloc' as the newly created second half. 'split' indicates an
...@@ -471,7 +464,8 @@ static int split_state(struct extent_io_tree *tree, struct extent_state *orig, ...@@ -471,7 +464,8 @@ static int split_state(struct extent_io_tree *tree, struct extent_state *orig,
{ {
struct rb_node *node; struct rb_node *node;
split_cb(tree, orig, split); if (tree->private_data && is_data_inode(tree->private_data))
btrfs_split_delalloc_extent(tree->private_data, orig, split);
prealloc->start = orig->start; prealloc->start = orig->start;
prealloc->end = split - 1; prealloc->end = split - 1;
......
...@@ -102,12 +102,6 @@ struct extent_io_ops { ...@@ -102,12 +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);
/*
* Optional hooks, called if the pointer is not NULL
*/
void (*split_extent_hook)(void *private_data,
struct extent_state *orig, u64 split);
}; };
struct extent_io_tree { struct extent_io_tree {
......
...@@ -1609,10 +1609,9 @@ int btrfs_run_delalloc_range(void *private_data, struct page *locked_page, ...@@ -1609,10 +1609,9 @@ int btrfs_run_delalloc_range(void *private_data, struct page *locked_page,
return ret; return ret;
} }
static void btrfs_split_extent_hook(void *private_data, void btrfs_split_delalloc_extent(struct inode *inode,
struct extent_state *orig, u64 split) struct extent_state *orig, u64 split)
{ {
struct inode *inode = private_data;
u64 size; u64 size;
/* not delalloc, ignore it */ /* not delalloc, ignore it */
...@@ -10504,9 +10503,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = { ...@@ -10504,9 +10503,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,
/* optional callbacks */
.split_extent_hook = btrfs_split_extent_hook,
}; };
/* /*
......
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