aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-10-15 16:19:22 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:56 -0400
commit19c00ddcc31ad4bdfb86b57085e06d6135b9b1d7 (patch)
treea48cbaac47070057912c1b35d270b61b7e14386c /fs/btrfs/extent_map.h
parent0f82731fc56448c2733f58e1f5db6c2cbfc90652 (diff)
Btrfs: Add back metadata checksumming
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_map.h')
-rw-r--r--fs/btrfs/extent_map.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h
index f1dc28d260eb..39d78d31b6a2 100644
--- a/fs/btrfs/extent_map.h
+++ b/fs/btrfs/extent_map.h
@@ -17,8 +17,17 @@
17#define EXTENT_DEFRAG (1 << 6) 17#define EXTENT_DEFRAG (1 << 6)
18#define EXTENT_DEFRAG_DONE (1 << 7) 18#define EXTENT_DEFRAG_DONE (1 << 7)
19#define EXTENT_BUFFER_FILLED (1 << 8) 19#define EXTENT_BUFFER_FILLED (1 << 8)
20#define EXTENT_CSUM (1 << 9)
20#define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK) 21#define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK)
21 22
23/*
24 * page->private values. Every page that is controlled by the extent
25 * map has page->private set to one.
26 */
27
28#define EXTENT_PAGE_PRIVATE 1
29#define EXTENT_PAGE_PRIVATE_FIRST_PAGE 3
30
22 31
23struct extent_map_ops { 32struct extent_map_ops {
24 int (*fill_delalloc)(struct inode *inode, u64 start, u64 end); 33 int (*fill_delalloc)(struct inode *inode, u64 start, u64 end);
@@ -89,7 +98,7 @@ typedef struct extent_map *(get_extent_t)(struct inode *inode,
89 98
90void extent_map_tree_init(struct extent_map_tree *tree, 99void extent_map_tree_init(struct extent_map_tree *tree,
91 struct address_space *mapping, gfp_t mask); 100 struct address_space *mapping, gfp_t mask);
92void extent_map_tree_cleanup(struct extent_map_tree *tree); 101void extent_map_tree_empty_lru(struct extent_map_tree *tree);
93struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, 102struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree,
94 u64 start, u64 end); 103 u64 start, u64 end);
95int add_extent_mapping(struct extent_map_tree *tree, 104int add_extent_mapping(struct extent_map_tree *tree,
@@ -143,13 +152,14 @@ void set_page_extent_mapped(struct page *page);
143 152
144struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree, 153struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree,
145 u64 start, unsigned long len, 154 u64 start, unsigned long len,
155 struct page *page0,
146 gfp_t mask); 156 gfp_t mask);
147struct extent_buffer *find_extent_buffer(struct extent_map_tree *tree, 157struct extent_buffer *find_extent_buffer(struct extent_map_tree *tree,
148 u64 start, unsigned long len, 158 u64 start, unsigned long len,
149 gfp_t mask); 159 gfp_t mask);
150void free_extent_buffer(struct extent_buffer *eb); 160void free_extent_buffer(struct extent_buffer *eb);
151int read_extent_buffer_pages(struct extent_map_tree *tree, 161int read_extent_buffer_pages(struct extent_map_tree *tree,
152 struct extent_buffer *eb, int wait); 162 struct extent_buffer *eb, u64 start, int wait);
153 163
154static inline void extent_buffer_get(struct extent_buffer *eb) 164static inline void extent_buffer_get(struct extent_buffer *eb)
155{ 165{
@@ -187,5 +197,9 @@ int map_extent_buffer(struct extent_buffer *eb, unsigned long offset,
187 unsigned long min_len, char **token, char **map, 197 unsigned long min_len, char **token, char **map,
188 unsigned long *map_start, 198 unsigned long *map_start,
189 unsigned long *map_len, int km); 199 unsigned long *map_len, int km);
200int map_private_extent_buffer(struct extent_buffer *eb, unsigned long offset,
201 unsigned long min_len, char **token, char **map,
202 unsigned long *map_start,
203 unsigned long *map_len, int km);
190void unmap_extent_buffer(struct extent_buffer *eb, char *token, int km); 204void unmap_extent_buffer(struct extent_buffer *eb, char *token, int km);
191#endif 205#endif