提交 c3988d63 编写于 作者: D David Sterba

btrfs: let writepage_end_io_hook return void

There's no error path in any of the instances, always return 0.
Reviewed-by: NLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 b9d04c60
...@@ -2437,12 +2437,9 @@ void end_extent_writepage(struct page *page, int err, u64 start, u64 end) ...@@ -2437,12 +2437,9 @@ void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
tree = &BTRFS_I(page->mapping->host)->io_tree; tree = &BTRFS_I(page->mapping->host)->io_tree;
if (tree->ops && tree->ops->writepage_end_io_hook) { if (tree->ops && tree->ops->writepage_end_io_hook)
ret = tree->ops->writepage_end_io_hook(page, start, tree->ops->writepage_end_io_hook(page, start, end, NULL,
end, NULL, uptodate); uptodate);
if (ret)
uptodate = 0;
}
if (!uptodate) { if (!uptodate) {
ClearPageUptodate(page); ClearPageUptodate(page);
......
...@@ -104,7 +104,7 @@ struct extent_io_ops { ...@@ -104,7 +104,7 @@ struct extent_io_ops {
int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset, int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset,
struct page *page, u64 start, u64 end, struct page *page, u64 start, u64 end,
int mirror); int mirror);
int (*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)(struct inode *inode, struct extent_state *state, void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
unsigned *bits); unsigned *bits);
......
...@@ -2972,7 +2972,7 @@ static void finish_ordered_fn(struct btrfs_work *work) ...@@ -2972,7 +2972,7 @@ static void finish_ordered_fn(struct btrfs_work *work)
btrfs_finish_ordered_io(ordered_extent); btrfs_finish_ordered_io(ordered_extent);
} }
static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, static void btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
struct extent_state *state, int uptodate) struct extent_state *state, int uptodate)
{ {
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
...@@ -2986,7 +2986,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -2986,7 +2986,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
ClearPagePrivate2(page); ClearPagePrivate2(page);
if (!btrfs_dec_test_ordered_pending(inode, &ordered_extent, start, if (!btrfs_dec_test_ordered_pending(inode, &ordered_extent, start,
end - start + 1, uptodate)) end - start + 1, uptodate))
return 0; return;
if (btrfs_is_free_space_inode(BTRFS_I(inode))) { if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
wq = fs_info->endio_freespace_worker; wq = fs_info->endio_freespace_worker;
...@@ -2999,8 +2999,6 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -2999,8 +2999,6 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
btrfs_init_work(&ordered_extent->work, func, finish_ordered_fn, NULL, btrfs_init_work(&ordered_extent->work, func, finish_ordered_fn, NULL,
NULL); NULL);
btrfs_queue_work(wq, &ordered_extent->work); btrfs_queue_work(wq, &ordered_extent->work);
return 0;
} }
static int __readpage_endio_check(struct inode *inode, static int __readpage_endio_check(struct inode *inode,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册