mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-04 14:23:46 +00:00
btrfs: Remove extent_io_ops::writepage_start_hook
This hook is called only from __extent_writepage_io which is already called only from the data page writeout path. So there is no need to make an indirect call via extent_io_ops. This patch just removes the callback definition, exports the callback function and calls it directly at the only call site. Also give the function a more descriptive name. No functional changes. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
5eaad97af8
commit
d75855b451
4 changed files with 12 additions and 16 deletions
|
@ -3192,6 +3192,7 @@ int btrfs_prealloc_file_range_trans(struct inode *inode,
|
||||||
int btrfs_run_delalloc_range(void *private_data, struct page *locked_page,
|
int btrfs_run_delalloc_range(void *private_data, struct page *locked_page,
|
||||||
u64 start, u64 end, int *page_started, unsigned long *nr_written,
|
u64 start, u64 end, int *page_started, unsigned long *nr_written,
|
||||||
struct writeback_control *wbc);
|
struct writeback_control *wbc);
|
||||||
|
int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end);
|
||||||
extern const struct dentry_operations btrfs_dentry_operations;
|
extern const struct dentry_operations btrfs_dentry_operations;
|
||||||
|
|
||||||
/* ioctl.c */
|
/* ioctl.c */
|
||||||
|
|
|
@ -3321,9 +3321,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
|
||||||
int nr = 0;
|
int nr = 0;
|
||||||
bool compressed;
|
bool compressed;
|
||||||
|
|
||||||
if (tree->ops && tree->ops->writepage_start_hook) {
|
ret = btrfs_writepage_cow_fixup(page, start, page_end);
|
||||||
ret = tree->ops->writepage_start_hook(page, start,
|
|
||||||
page_end);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
/* Fixup worker will requeue */
|
/* Fixup worker will requeue */
|
||||||
if (ret == -EBUSY)
|
if (ret == -EBUSY)
|
||||||
|
@ -3335,7 +3333,6 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we don't want to touch the inode after unlocking the page,
|
* we don't want to touch the inode after unlocking the page,
|
||||||
|
|
|
@ -106,7 +106,6 @@ struct extent_io_ops {
|
||||||
/*
|
/*
|
||||||
* Optional hooks, called if the pointer is not NULL
|
* Optional hooks, called if the pointer is not NULL
|
||||||
*/
|
*/
|
||||||
int (*writepage_start_hook)(struct page *page, u64 start, u64 end);
|
|
||||||
void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
|
void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
|
||||||
struct extent_state *state, int uptodate);
|
struct extent_state *state, int uptodate);
|
||||||
void (*set_bit_hook)(void *private_data, struct extent_state *state,
|
void (*set_bit_hook)(void *private_data, struct extent_state *state,
|
||||||
|
|
|
@ -2152,7 +2152,7 @@ out_page:
|
||||||
* to fix it up. The async helper will wait for ordered extents, set
|
* to fix it up. The async helper will wait for ordered extents, set
|
||||||
* the delalloc bit and make it safe to write the page.
|
* the delalloc bit and make it safe to write the page.
|
||||||
*/
|
*/
|
||||||
static int btrfs_writepage_start_hook(struct page *page, u64 start, u64 end)
|
int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end)
|
||||||
{
|
{
|
||||||
struct inode *inode = page->mapping->host;
|
struct inode *inode = page->mapping->host;
|
||||||
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
|
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
|
||||||
|
@ -10527,7 +10527,6 @@ static const struct extent_io_ops btrfs_extent_io_ops = {
|
||||||
|
|
||||||
/* optional callbacks */
|
/* optional callbacks */
|
||||||
.writepage_end_io_hook = btrfs_writepage_end_io_hook,
|
.writepage_end_io_hook = btrfs_writepage_end_io_hook,
|
||||||
.writepage_start_hook = btrfs_writepage_start_hook,
|
|
||||||
.set_bit_hook = btrfs_set_bit_hook,
|
.set_bit_hook = btrfs_set_bit_hook,
|
||||||
.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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue