diff options
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 25900af5b15d..711d12b80028 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -27,6 +27,7 @@ | |||
27 | * type for this bio | 27 | * type for this bio |
28 | */ | 28 | */ |
29 | #define EXTENT_BIO_COMPRESSED 1 | 29 | #define EXTENT_BIO_COMPRESSED 1 |
30 | #define EXTENT_BIO_TREE_LOG 2 | ||
30 | #define EXTENT_BIO_FLAG_SHIFT 16 | 31 | #define EXTENT_BIO_FLAG_SHIFT 16 |
31 | 32 | ||
32 | /* these are bit numbers for test/set bit */ | 33 | /* these are bit numbers for test/set bit */ |
@@ -232,11 +233,15 @@ int set_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, | |||
232 | int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, | 233 | int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, |
233 | gfp_t mask); | 234 | gfp_t mask); |
234 | int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, | 235 | int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, |
235 | int bits, int clear_bits, gfp_t mask); | 236 | int bits, int clear_bits, |
237 | struct extent_state **cached_state, gfp_t mask); | ||
236 | int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end, | 238 | int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end, |
237 | struct extent_state **cached_state, gfp_t mask); | 239 | struct extent_state **cached_state, gfp_t mask); |
240 | int set_extent_defrag(struct extent_io_tree *tree, u64 start, u64 end, | ||
241 | struct extent_state **cached_state, gfp_t mask); | ||
238 | int find_first_extent_bit(struct extent_io_tree *tree, u64 start, | 242 | int find_first_extent_bit(struct extent_io_tree *tree, u64 start, |
239 | u64 *start_ret, u64 *end_ret, int bits); | 243 | u64 *start_ret, u64 *end_ret, int bits, |
244 | struct extent_state **cached_state); | ||
240 | struct extent_state *find_first_extent_bit_state(struct extent_io_tree *tree, | 245 | struct extent_state *find_first_extent_bit_state(struct extent_io_tree *tree, |
241 | u64 start, int bits); | 246 | u64 start, int bits); |
242 | int extent_invalidatepage(struct extent_io_tree *tree, | 247 | int extent_invalidatepage(struct extent_io_tree *tree, |
@@ -277,8 +282,18 @@ void free_extent_buffer_stale(struct extent_buffer *eb); | |||
277 | int read_extent_buffer_pages(struct extent_io_tree *tree, | 282 | int read_extent_buffer_pages(struct extent_io_tree *tree, |
278 | struct extent_buffer *eb, u64 start, int wait, | 283 | struct extent_buffer *eb, u64 start, int wait, |
279 | get_extent_t *get_extent, int mirror_num); | 284 | get_extent_t *get_extent, int mirror_num); |
280 | unsigned long num_extent_pages(u64 start, u64 len); | 285 | |
281 | struct page *extent_buffer_page(struct extent_buffer *eb, unsigned long i); | 286 | static inline unsigned long num_extent_pages(u64 start, u64 len) |
287 | { | ||
288 | return ((start + len + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) - | ||
289 | (start >> PAGE_CACHE_SHIFT); | ||
290 | } | ||
291 | |||
292 | static inline struct page *extent_buffer_page(struct extent_buffer *eb, | ||
293 | unsigned long i) | ||
294 | { | ||
295 | return eb->pages[i]; | ||
296 | } | ||
282 | 297 | ||
283 | static inline void extent_buffer_get(struct extent_buffer *eb) | 298 | static inline void extent_buffer_get(struct extent_buffer *eb) |
284 | { | 299 | { |