aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2011-06-10 07:55:54 -0400
committerArne Jansen <sensille@gmx.net>2011-10-02 02:48:44 -0400
commit4bb31e928d1a47f5bd046ecb176b8eff7c589fc0 (patch)
tree61693e91f7a179b75cc43f5bcb504d50a342ecb7 /fs/btrfs/extent_io.c
parent7414a03fbf9e75fbbf2a3c16828cd862e572aa44 (diff)
btrfs: hooks for readahead
This adds the hooks needed for readahead. In the readpage_end_io_hook, the extent state is checked for the EXTENT_READAHEAD flag. Only in this case the readahead hook is called, to keep the impact on non-ra as low as possible. Additionally, a hook for a failed IO is added, otherwise readahead would wait indefinitely for the extent to finish. Changes for v2: - eliminate race condition Signed-off-by: Arne Jansen <sensille@gmx.net>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 823028e73cf8..deba714236d7 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -1731,7 +1731,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
1731 if (!uptodate && tree->ops && 1731 if (!uptodate && tree->ops &&
1732 tree->ops->readpage_io_failed_hook) { 1732 tree->ops->readpage_io_failed_hook) {
1733 ret = tree->ops->readpage_io_failed_hook(bio, page, 1733 ret = tree->ops->readpage_io_failed_hook(bio, page,
1734 start, end, NULL); 1734 start, end, state);
1735 if (ret == 0) { 1735 if (ret == 0) {
1736 uptodate = 1736 uptodate =
1737 test_bit(BIO_UPTODATE, &bio->bi_flags); 1737 test_bit(BIO_UPTODATE, &bio->bi_flags);