aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r--fs/btrfs/extent_io.h65
1 files changed, 33 insertions, 32 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index ece9ce87edff..695b0ccfb755 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -4,22 +4,22 @@
4#include <linux/rbtree.h> 4#include <linux/rbtree.h>
5 5
6/* bits for the extent state */ 6/* bits for the extent state */
7#define EXTENT_DIRTY 1 7#define EXTENT_DIRTY (1U << 0)
8#define EXTENT_WRITEBACK (1 << 1) 8#define EXTENT_WRITEBACK (1U << 1)
9#define EXTENT_UPTODATE (1 << 2) 9#define EXTENT_UPTODATE (1U << 2)
10#define EXTENT_LOCKED (1 << 3) 10#define EXTENT_LOCKED (1U << 3)
11#define EXTENT_NEW (1 << 4) 11#define EXTENT_NEW (1U << 4)
12#define EXTENT_DELALLOC (1 << 5) 12#define EXTENT_DELALLOC (1U << 5)
13#define EXTENT_DEFRAG (1 << 6) 13#define EXTENT_DEFRAG (1U << 6)
14#define EXTENT_BOUNDARY (1 << 9) 14#define EXTENT_BOUNDARY (1U << 9)
15#define EXTENT_NODATASUM (1 << 10) 15#define EXTENT_NODATASUM (1U << 10)
16#define EXTENT_DO_ACCOUNTING (1 << 11) 16#define EXTENT_DO_ACCOUNTING (1U << 11)
17#define EXTENT_FIRST_DELALLOC (1 << 12) 17#define EXTENT_FIRST_DELALLOC (1U << 12)
18#define EXTENT_NEED_WAIT (1 << 13) 18#define EXTENT_NEED_WAIT (1U << 13)
19#define EXTENT_DAMAGED (1 << 14) 19#define EXTENT_DAMAGED (1U << 14)
20#define EXTENT_NORESERVE (1 << 15) 20#define EXTENT_NORESERVE (1U << 15)
21#define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK) 21#define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK)
22#define EXTENT_CTLBITS (EXTENT_DO_ACCOUNTING | EXTENT_FIRST_DELALLOC) 22#define EXTENT_CTLBITS (EXTENT_DO_ACCOUNTING | EXTENT_FIRST_DELALLOC)
23 23
24/* 24/*
25 * flags for bio submission. The high bits indicate the compression 25 * flags for bio submission. The high bits indicate the compression
@@ -81,9 +81,9 @@ struct extent_io_ops {
81 int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end, 81 int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end,
82 struct extent_state *state, int uptodate); 82 struct extent_state *state, int uptodate);
83 void (*set_bit_hook)(struct inode *inode, struct extent_state *state, 83 void (*set_bit_hook)(struct inode *inode, struct extent_state *state,
84 unsigned long *bits); 84 unsigned *bits);
85 void (*clear_bit_hook)(struct inode *inode, struct extent_state *state, 85 void (*clear_bit_hook)(struct inode *inode, struct extent_state *state,
86 unsigned long *bits); 86 unsigned *bits);
87 void (*merge_extent_hook)(struct inode *inode, 87 void (*merge_extent_hook)(struct inode *inode,
88 struct extent_state *new, 88 struct extent_state *new,
89 struct extent_state *other); 89 struct extent_state *other);
@@ -108,7 +108,7 @@ struct extent_state {
108 /* ADD NEW ELEMENTS AFTER THIS */ 108 /* ADD NEW ELEMENTS AFTER THIS */
109 wait_queue_head_t wq; 109 wait_queue_head_t wq;
110 atomic_t refs; 110 atomic_t refs;
111 unsigned long state; 111 unsigned state;
112 112
113 /* for use by the FS */ 113 /* for use by the FS */
114 u64 private; 114 u64 private;
@@ -188,7 +188,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
188int try_release_extent_buffer(struct page *page); 188int try_release_extent_buffer(struct page *page);
189int lock_extent(struct extent_io_tree *tree, u64 start, u64 end); 189int lock_extent(struct extent_io_tree *tree, u64 start, u64 end);
190int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 190int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
191 unsigned long bits, struct extent_state **cached); 191 unsigned bits, struct extent_state **cached);
192int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end); 192int unlock_extent(struct extent_io_tree *tree, u64 start, u64 end);
193int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end, 193int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end,
194 struct extent_state **cached, gfp_t mask); 194 struct extent_state **cached, gfp_t mask);
@@ -202,21 +202,21 @@ void extent_io_exit(void);
202 202
203u64 count_range_bits(struct extent_io_tree *tree, 203u64 count_range_bits(struct extent_io_tree *tree,
204 u64 *start, u64 search_end, 204 u64 *start, u64 search_end,
205 u64 max_bytes, unsigned long bits, int contig); 205 u64 max_bytes, unsigned bits, int contig);
206 206
207void free_extent_state(struct extent_state *state); 207void free_extent_state(struct extent_state *state);
208int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, 208int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end,
209 unsigned long bits, int filled, 209 unsigned bits, int filled,
210 struct extent_state *cached_state); 210 struct extent_state *cached_state);
211int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 211int clear_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
212 unsigned long bits, gfp_t mask); 212 unsigned bits, gfp_t mask);
213int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, 213int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
214 unsigned long bits, int wake, int delete, 214 unsigned bits, int wake, int delete,
215 struct extent_state **cached, gfp_t mask); 215 struct extent_state **cached, gfp_t mask);
216int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end, 216int set_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
217 unsigned long bits, gfp_t mask); 217 unsigned bits, gfp_t mask);
218int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, 218int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
219 unsigned long bits, u64 *failed_start, 219 unsigned bits, u64 *failed_start,
220 struct extent_state **cached_state, gfp_t mask); 220 struct extent_state **cached_state, gfp_t mask);
221int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end, 221int set_extent_uptodate(struct extent_io_tree *tree, u64 start, u64 end,
222 struct extent_state **cached_state, gfp_t mask); 222 struct extent_state **cached_state, gfp_t mask);
@@ -229,14 +229,14 @@ int set_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end,
229int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end, 229int clear_extent_dirty(struct extent_io_tree *tree, u64 start, u64 end,
230 gfp_t mask); 230 gfp_t mask);
231int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, 231int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
232 unsigned long bits, unsigned long clear_bits, 232 unsigned bits, unsigned clear_bits,
233 struct extent_state **cached_state, gfp_t mask); 233 struct extent_state **cached_state, gfp_t mask);
234int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end, 234int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end,
235 struct extent_state **cached_state, gfp_t mask); 235 struct extent_state **cached_state, gfp_t mask);
236int set_extent_defrag(struct extent_io_tree *tree, u64 start, u64 end, 236int set_extent_defrag(struct extent_io_tree *tree, u64 start, u64 end,
237 struct extent_state **cached_state, gfp_t mask); 237 struct extent_state **cached_state, gfp_t mask);
238int find_first_extent_bit(struct extent_io_tree *tree, u64 start, 238int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
239 u64 *start_ret, u64 *end_ret, unsigned long bits, 239 u64 *start_ret, u64 *end_ret, unsigned bits,
240 struct extent_state **cached_state); 240 struct extent_state **cached_state);
241int extent_invalidatepage(struct extent_io_tree *tree, 241int extent_invalidatepage(struct extent_io_tree *tree,
242 struct page *page, unsigned long offset); 242 struct page *page, unsigned long offset);
@@ -262,8 +262,9 @@ int get_state_private(struct extent_io_tree *tree, u64 start, u64 *private);
262void set_page_extent_mapped(struct page *page); 262void set_page_extent_mapped(struct page *page);
263 263
264struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, 264struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info,
265 u64 start, unsigned long len); 265 u64 start);
266struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len); 266struct extent_buffer *alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
267 u64 start);
267struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src); 268struct extent_buffer *btrfs_clone_extent_buffer(struct extent_buffer *src);
268struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info, 269struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info,
269 u64 start); 270 u64 start);
@@ -322,7 +323,7 @@ int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end);
322int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end); 323int extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end);
323int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end, 324int extent_clear_unlock_delalloc(struct inode *inode, u64 start, u64 end,
324 struct page *locked_page, 325 struct page *locked_page,
325 unsigned long bits_to_clear, 326 unsigned bits_to_clear,
326 unsigned long page_ops); 327 unsigned long page_ops);
327struct bio * 328struct bio *
328btrfs_bio_alloc(struct block_device *bdev, u64 first_sector, int nr_vecs, 329btrfs_bio_alloc(struct block_device *bdev, u64 first_sector, int nr_vecs,
@@ -377,5 +378,5 @@ noinline u64 find_lock_delalloc_range(struct inode *inode,
377 u64 *end, u64 max_bytes); 378 u64 *end, u64 max_bytes);
378#endif 379#endif
379struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info, 380struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info,
380 u64 start, unsigned long len); 381 u64 start);
381#endif 382#endif