aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-03-26 21:57:36 -0400
committerChris Mason <chris.mason@oracle.com>2012-03-26 21:57:36 -0400
commitea466794084f55d8fcc100711cf17923bf57e962 (patch)
tree9905d556655ff0f036936ea51f9aa214bd2cbce8 /fs/btrfs/extent_io.h
parentf3f266ab1bfe4770375d24fa8e72a03278e9450a (diff)
Btrfs: deal with read errors on extent buffers differently
Since we need to read and write extent buffers in their entirety we can't use the normal bio_readpage_error stuff since it only works on a per page basis. So instead make it so that if we see an io error in endio we just mark the eb as having an IO error and then in btree_read_extent_buffer_pages we will manually try other mirrors and then overwrite the bad mirror if we find a good copy. This works with larger than page size blocks. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r--fs/btrfs/extent_io.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 489d7945154..38c1af7092f 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -58,6 +58,7 @@
58#define EXTENT_PAGE_PRIVATE_FIRST_PAGE 3 58#define EXTENT_PAGE_PRIVATE_FIRST_PAGE 3
59 59
60struct extent_state; 60struct extent_state;
61struct btrfs_root;
61 62
62typedef int (extent_submit_bio_hook_t)(struct inode *inode, int rw, 63typedef int (extent_submit_bio_hook_t)(struct inode *inode, int rw,
63 struct bio *bio, int mirror_num, 64 struct bio *bio, int mirror_num,
@@ -73,9 +74,7 @@ struct extent_io_ops {
73 size_t size, struct bio *bio, 74 size_t size, struct bio *bio,
74 unsigned long bio_flags); 75 unsigned long bio_flags);
75 int (*readpage_io_hook)(struct page *page, u64 start, u64 end); 76 int (*readpage_io_hook)(struct page *page, u64 start, u64 end);
76 int (*readpage_io_failed_hook)(struct bio *bio, struct page *page, 77 int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
77 u64 start, u64 end, int failed_mirror,
78 struct extent_state *state);
79 int (*writepage_io_failed_hook)(struct bio *bio, struct page *page, 78 int (*writepage_io_failed_hook)(struct bio *bio, struct page *page,
80 u64 start, u64 end, 79 u64 start, u64 end,
81 struct extent_state *state); 80 struct extent_state *state);
@@ -136,6 +135,7 @@ struct extent_buffer {
136 spinlock_t refs_lock; 135 spinlock_t refs_lock;
137 atomic_t refs; 136 atomic_t refs;
138 atomic_t io_pages; 137 atomic_t io_pages;
138 int failed_mirror;
139 struct list_head leak_list; 139 struct list_head leak_list;
140 struct rcu_head rcu_head; 140 struct rcu_head rcu_head;
141 pid_t lock_owner; 141 pid_t lock_owner;
@@ -327,4 +327,6 @@ int repair_io_failure(struct btrfs_mapping_tree *map_tree, u64 start,
327 u64 length, u64 logical, struct page *page, 327 u64 length, u64 logical, struct page *page,
328 int mirror_num); 328 int mirror_num);
329int end_extent_writepage(struct page *page, int err, u64 start, u64 end); 329int end_extent_writepage(struct page *page, int err, u64 start, u64 end);
330int repair_eb_io_failure(struct btrfs_root *root, struct extent_buffer *eb,
331 int mirror_num);
330#endif 332#endif