diff options
Diffstat (limited to 'fs/btrfs/extent_map.h')
-rw-r--r-- | fs/btrfs/extent_map.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index e91a2e9619ee..0eae6c420acb 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h | |||
@@ -6,12 +6,19 @@ | |||
6 | #define EXTENT_MAP_INLINE (u64)-2 | 6 | #define EXTENT_MAP_INLINE (u64)-2 |
7 | #define EXTENT_MAP_DELALLOC (u64)-1 | 7 | #define EXTENT_MAP_DELALLOC (u64)-1 |
8 | 8 | ||
9 | struct extent_map_ops { | ||
10 | int (*fill_delalloc)(struct inode *inode, 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); | ||
13 | int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end); | ||
14 | }; | ||
15 | |||
9 | struct extent_map_tree { | 16 | struct extent_map_tree { |
10 | struct rb_root map; | 17 | struct rb_root map; |
11 | struct rb_root state; | 18 | struct rb_root state; |
12 | struct address_space *mapping; | 19 | struct address_space *mapping; |
13 | rwlock_t lock; | 20 | rwlock_t lock; |
14 | int (*fill_delalloc)(struct inode *inode, u64 start, u64 end); | 21 | struct extent_map_ops *ops; |
15 | }; | 22 | }; |
16 | 23 | ||
17 | /* note, this must start with the same fields as fs/extent_map.c:tree_entry */ | 24 | /* note, this must start with the same fields as fs/extent_map.c:tree_entry */ |
@@ -36,6 +43,10 @@ struct extent_state { | |||
36 | wait_queue_head_t wq; | 43 | wait_queue_head_t wq; |
37 | atomic_t refs; | 44 | atomic_t refs; |
38 | unsigned long state; | 45 | unsigned long state; |
46 | |||
47 | /* for use by the FS */ | ||
48 | u64 private; | ||
49 | |||
39 | struct list_head list; | 50 | struct list_head list; |
40 | }; | 51 | }; |
41 | 52 | ||
@@ -89,4 +100,6 @@ int extent_commit_write(struct extent_map_tree *tree, | |||
89 | struct inode *inode, struct page *page, | 100 | struct inode *inode, struct page *page, |
90 | unsigned from, unsigned to); | 101 | unsigned from, unsigned to); |
91 | int set_range_dirty(struct extent_map_tree *tree, u64 start, u64 end); | 102 | int set_range_dirty(struct extent_map_tree *tree, u64 start, u64 end); |
103 | int set_state_private(struct extent_map_tree *tree, u64 start, u64 private); | ||
104 | int get_state_private(struct extent_map_tree *tree, u64 start, u64 *private); | ||
92 | #endif | 105 | #endif |