4 #include <linux/rbtree.h>
6 #define EXTENT_MAP_LAST_BYTE (u64)-4
7 #define EXTENT_MAP_HOLE (u64)-3
8 #define EXTENT_MAP_INLINE (u64)-2
9 #define EXTENT_MAP_DELALLOC (u64)-1
12 struct rb_node rb_node;
14 /* all of these are in bytes */
19 struct block_device *bdev;
24 struct extent_map_tree {
26 struct extent_map *last;
30 static inline u64 extent_map_end(struct extent_map *em)
32 if (em->start + em->len < em->start)
34 return em->start + em->len;
37 static inline u64 extent_map_block_end(struct extent_map *em)
39 if (em->block_start + em->len < em->block_start)
41 return em->block_start + em->len;
44 void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask);
45 struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree,
47 int add_extent_mapping(struct extent_map_tree *tree,
48 struct extent_map *em);
49 int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em);
51 struct extent_map *alloc_extent_map(gfp_t mask);
52 void free_extent_map(struct extent_map *em);
53 int __init extent_map_init(void);
54 void extent_map_exit(void);