Skip to content

Commit c3988d6

Browse files
committed
btrfs: let writepage_end_io_hook return void
There's no error path in any of the instances, always return 0. Reviewed-by: Liu Bo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b9d04c6 commit c3988d6

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

fs/btrfs/extent_io.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,12 +2437,9 @@ void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
24372437

24382438
tree = &BTRFS_I(page->mapping->host)->io_tree;
24392439

2440-
if (tree->ops && tree->ops->writepage_end_io_hook) {
2441-
ret = tree->ops->writepage_end_io_hook(page, start,
2442-
end, NULL, uptodate);
2443-
if (ret)
2444-
uptodate = 0;
2445-
}
2440+
if (tree->ops && tree->ops->writepage_end_io_hook)
2441+
tree->ops->writepage_end_io_hook(page, start, end, NULL,
2442+
uptodate);
24462443

24472444
if (!uptodate) {
24482445
ClearPageUptodate(page);

fs/btrfs/extent_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct extent_io_ops {
104104
int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset,
105105
struct page *page, u64 start, u64 end,
106106
int mirror);
107-
int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
107+
void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
108108
struct extent_state *state, int uptodate);
109109
void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
110110
unsigned *bits);

fs/btrfs/inode.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,7 +2972,7 @@ static void finish_ordered_fn(struct btrfs_work *work)
29722972
btrfs_finish_ordered_io(ordered_extent);
29732973
}
29742974

2975-
static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
2975+
static void btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
29762976
struct extent_state *state, int uptodate)
29772977
{
29782978
struct inode *inode = page->mapping->host;
@@ -2986,7 +2986,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
29862986
ClearPagePrivate2(page);
29872987
if (!btrfs_dec_test_ordered_pending(inode, &ordered_extent, start,
29882988
end - start + 1, uptodate))
2989-
return 0;
2989+
return;
29902990

29912991
if (btrfs_is_free_space_inode(BTRFS_I(inode))) {
29922992
wq = fs_info->endio_freespace_worker;
@@ -2999,8 +2999,6 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
29992999
btrfs_init_work(&ordered_extent->work, func, finish_ordered_fn, NULL,
30003000
NULL);
30013001
btrfs_queue_work(wq, &ordered_extent->work);
3002-
3003-
return 0;
30043002
}
30053003

30063004
static int __readpage_endio_check(struct inode *inode,

0 commit comments

Comments
 (0)