Commit 65a680f6 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove extent_io_ops::check_extent_io_range callback

This callback was only used in debug builds by btrfs_leak_debug_check.
A better approach is to move its implementation in
btrfs_leak_debug_check and ensure the latter is only executed for extent
tree which have ->private_data set i.e. relate to a data node and not
the btree one. 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 7087a9d8
...@@ -89,9 +89,18 @@ void btrfs_leak_debug_check(void) ...@@ -89,9 +89,18 @@ void btrfs_leak_debug_check(void)
static inline void __btrfs_debug_check_extent_io_range(const char *caller, static inline void __btrfs_debug_check_extent_io_range(const char *caller,
struct extent_io_tree *tree, u64 start, u64 end) struct extent_io_tree *tree, u64 start, u64 end)
{ {
if (tree->ops && tree->ops->check_extent_io_range) struct inode *inode = tree->private_data;
tree->ops->check_extent_io_range(tree->private_data, caller, u64 isize;
start, end);
if (!inode || !is_data_inode(inode))
return;
isize = i_size_read(inode);
if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) {
btrfs_debug_rl(BTRFS_I(inode)->root->fs_info,
"%s: ino %llu isize %llu odd range [%llu,%llu]",
caller, btrfs_ino(BTRFS_I(inode)), isize, start, end);
}
} }
#else #else
#define btrfs_leak_debug_add(new, head) do {} while (0) #define btrfs_leak_debug_add(new, head) do {} while (0)
......
...@@ -116,8 +116,6 @@ struct extent_io_ops { ...@@ -116,8 +116,6 @@ struct extent_io_ops {
struct extent_state *other); struct extent_state *other);
void (*split_extent_hook)(void *private_data, void (*split_extent_hook)(void *private_data,
struct extent_state *orig, u64 split); struct extent_state *orig, u64 split);
void (*check_extent_io_range)(void *private_data, const char *caller,
u64 start, u64 end);
}; };
struct extent_io_tree { struct extent_io_tree {
......
...@@ -10451,20 +10451,6 @@ static int btrfs_readpage_io_failed_hook(struct page *page, int failed_mirror) ...@@ -10451,20 +10451,6 @@ static int btrfs_readpage_io_failed_hook(struct page *page, int failed_mirror)
return -EAGAIN; return -EAGAIN;
} }
static void btrfs_check_extent_io_range(void *private_data, const char *caller,
u64 start, u64 end)
{
struct inode *inode = private_data;
u64 isize;
isize = i_size_read(inode);
if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) {
btrfs_debug_rl(BTRFS_I(inode)->root->fs_info,
"%s: ino %llu isize %llu odd range [%llu,%llu]",
caller, btrfs_ino(BTRFS_I(inode)), isize, start, end);
}
}
void btrfs_set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end) void btrfs_set_range_writeback(struct extent_io_tree *tree, u64 start, u64 end)
{ {
struct inode *inode = tree->private_data; struct inode *inode = tree->private_data;
...@@ -10530,7 +10516,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = { ...@@ -10530,7 +10516,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = {
.clear_bit_hook = btrfs_clear_bit_hook, .clear_bit_hook = btrfs_clear_bit_hook,
.merge_extent_hook = btrfs_merge_extent_hook, .merge_extent_hook = btrfs_merge_extent_hook,
.split_extent_hook = btrfs_split_extent_hook, .split_extent_hook = btrfs_split_extent_hook,
.check_extent_io_range = btrfs_check_extent_io_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