Commit 0e2752a7 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Woodhouse

Btrfs: [PATCH] extent_map: add writepage_end_io hook

XFS updates the ondisk inode size only after the data I/O has finished,
so it needs a hook when the writepage end_bio handler has finished.

Might not be worth applying as-is as the per-page callback is very
ineffcient.  What XFS really wants is a callback when writeout of a
whole extent has completed.  This delayed i_size updates scheme might
be worthwile for btrfs aswell, btw.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent b06355f0
...@@ -1231,6 +1231,8 @@ static int end_bio_extent_writepage(struct bio *bio, ...@@ -1231,6 +1231,8 @@ static int end_bio_extent_writepage(struct bio *bio,
end_page_writeback(page); end_page_writeback(page);
else else
check_page_writeback(tree, page); check_page_writeback(tree, page);
if (tree->ops && tree->ops->writepage_end_io_hook)
tree->ops->writepage_end_io_hook(page, start, end);
} while (bvec >= bio->bi_io_vec); } while (bvec >= bio->bi_io_vec);
bio_put(bio); bio_put(bio);
......
...@@ -11,6 +11,7 @@ struct extent_map_ops { ...@@ -11,6 +11,7 @@ struct extent_map_ops {
int (*writepage_io_hook)(struct page *page, u64 start, u64 end); int (*writepage_io_hook)(struct page *page, u64 start, u64 end);
int (*readpage_io_hook)(struct page *page, u64 start, u64 end); int (*readpage_io_hook)(struct page *page, u64 start, u64 end);
int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end); int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end);
void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end);
}; };
struct extent_map_tree { struct extent_map_tree {
......
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