diff options
author | Christoph Hellwig <hch@lst.de> | 2007-09-10 20:02:33 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-09-10 20:02:33 -0400 |
commit | 0e2752a72cb37075b24899f01e9bc6a589de3b6c (patch) | |
tree | 63bd02f3ba81018ffa0178f6f0982defd33b1d99 | |
parent | b06355f0fe04a62d08238438654ec453e05304ba (diff) |
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/extent_map.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent_map.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 162766773a32..ab5bde31b687 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -1231,6 +1231,8 @@ static int end_bio_extent_writepage(struct bio *bio, | |||
1231 | end_page_writeback(page); | 1231 | end_page_writeback(page); |
1232 | else | 1232 | else |
1233 | check_page_writeback(tree, page); | 1233 | check_page_writeback(tree, page); |
1234 | if (tree->ops && tree->ops->writepage_end_io_hook) | ||
1235 | tree->ops->writepage_end_io_hook(page, start, end); | ||
1234 | } while (bvec >= bio->bi_io_vec); | 1236 | } while (bvec >= bio->bi_io_vec); |
1235 | 1237 | ||
1236 | bio_put(bio); | 1238 | bio_put(bio); |
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index da41aca74e0b..40b53ee274fb 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h | |||
@@ -11,6 +11,7 @@ struct extent_map_ops { | |||
11 | int (*writepage_io_hook)(struct page *page, u64 start, u64 end); | 11 | int (*writepage_io_hook)(struct page *page, u64 start, u64 end); |
12 | int (*readpage_io_hook)(struct page *page, u64 start, u64 end); | 12 | int (*readpage_io_hook)(struct page *page, u64 start, u64 end); |
13 | int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end); | 13 | int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end); |
14 | void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end); | ||
14 | }; | 15 | }; |
15 | 16 | ||
16 | struct extent_map_tree { | 17 | struct extent_map_tree { |