|
@@ -92,18 +92,27 @@ typedef int (extent_submit_bio_hook_t)(struct inode *inode, struct bio *bio,
|
|
int mirror_num, unsigned long bio_flags,
|
|
int mirror_num, unsigned long bio_flags,
|
|
u64 bio_offset);
|
|
u64 bio_offset);
|
|
struct extent_io_ops {
|
|
struct extent_io_ops {
|
|
- int (*fill_delalloc)(struct inode *inode, struct page *locked_page,
|
|
|
|
- u64 start, u64 end, int *page_started,
|
|
|
|
- unsigned long *nr_written);
|
|
|
|
- int (*writepage_start_hook)(struct page *page, u64 start, u64 end);
|
|
|
|
|
|
+ /*
|
|
|
|
+ * The following callbacks must be allways defined, the function
|
|
|
|
+ * pointer will be called unconditionally.
|
|
|
|
+ */
|
|
extent_submit_bio_hook_t *submit_bio_hook;
|
|
extent_submit_bio_hook_t *submit_bio_hook;
|
|
|
|
+ int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset,
|
|
|
|
+ struct page *page, u64 start, u64 end,
|
|
|
|
+ int mirror);
|
|
int (*merge_bio_hook)(struct page *page, unsigned long offset,
|
|
int (*merge_bio_hook)(struct page *page, unsigned long offset,
|
|
size_t size, struct bio *bio,
|
|
size_t size, struct bio *bio,
|
|
unsigned long bio_flags);
|
|
unsigned long bio_flags);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Optional hooks, called if the pointer is not NULL
|
|
|
|
+ */
|
|
|
|
+ int (*fill_delalloc)(struct inode *inode, struct page *locked_page,
|
|
|
|
+ u64 start, u64 end, int *page_started,
|
|
|
|
+ unsigned long *nr_written);
|
|
int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
|
|
int (*readpage_io_failed_hook)(struct page *page, int failed_mirror);
|
|
- int (*readpage_end_io_hook)(struct btrfs_io_bio *io_bio, u64 phy_offset,
|
|
|
|
- struct page *page, u64 start, u64 end,
|
|
|
|
- int mirror);
|
|
|
|
|
|
+
|
|
|
|
+ int (*writepage_start_hook)(struct page *page, u64 start, u64 end);
|
|
void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
|
|
void (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
|
|
struct extent_state *state, int uptodate);
|
|
struct extent_state *state, int uptodate);
|
|
void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
|
|
void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
|