diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/btrfs/extent_map.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r-- | fs/btrfs/extent_map.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 454ca52d6451..2d0410344ea3 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/hardirq.h> | 5 | #include <linux/hardirq.h> |
6 | #include "ctree.h" | ||
6 | #include "extent_map.h" | 7 | #include "extent_map.h" |
7 | 8 | ||
8 | 9 | ||
@@ -27,12 +28,11 @@ void extent_map_exit(void) | |||
27 | /** | 28 | /** |
28 | * extent_map_tree_init - initialize extent map tree | 29 | * extent_map_tree_init - initialize extent map tree |
29 | * @tree: tree to initialize | 30 | * @tree: tree to initialize |
30 | * @mask: flags for memory allocations during tree operations | ||
31 | * | 31 | * |
32 | * Initialize the extent tree @tree. Should be called for each new inode | 32 | * Initialize the extent tree @tree. Should be called for each new inode |
33 | * or other user of the extent_map interface. | 33 | * or other user of the extent_map interface. |
34 | */ | 34 | */ |
35 | void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask) | 35 | void extent_map_tree_init(struct extent_map_tree *tree) |
36 | { | 36 | { |
37 | tree->map = RB_ROOT; | 37 | tree->map = RB_ROOT; |
38 | rwlock_init(&tree->lock); | 38 | rwlock_init(&tree->lock); |
@@ -40,20 +40,20 @@ void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask) | |||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * alloc_extent_map - allocate new extent map structure | 42 | * alloc_extent_map - allocate new extent map structure |
43 | * @mask: memory allocation flags | ||
44 | * | 43 | * |
45 | * Allocate a new extent_map structure. The new structure is | 44 | * Allocate a new extent_map structure. The new structure is |
46 | * returned with a reference count of one and needs to be | 45 | * returned with a reference count of one and needs to be |
47 | * freed using free_extent_map() | 46 | * freed using free_extent_map() |
48 | */ | 47 | */ |
49 | struct extent_map *alloc_extent_map(gfp_t mask) | 48 | struct extent_map *alloc_extent_map(void) |
50 | { | 49 | { |
51 | struct extent_map *em; | 50 | struct extent_map *em; |
52 | em = kmem_cache_alloc(extent_map_cache, mask); | 51 | em = kmem_cache_alloc(extent_map_cache, GFP_NOFS); |
53 | if (!em || IS_ERR(em)) | 52 | if (!em) |
54 | return em; | 53 | return NULL; |
55 | em->in_tree = 0; | 54 | em->in_tree = 0; |
56 | em->flags = 0; | 55 | em->flags = 0; |
56 | em->compress_type = BTRFS_COMPRESS_NONE; | ||
57 | atomic_set(&em->refs, 1); | 57 | atomic_set(&em->refs, 1); |
58 | return em; | 58 | return em; |
59 | } | 59 | } |
@@ -241,7 +241,7 @@ out: | |||
241 | * Insert @em into @tree or perform a simple forward/backward merge with | 241 | * Insert @em into @tree or perform a simple forward/backward merge with |
242 | * existing mappings. The extent_map struct passed in will be inserted | 242 | * existing mappings. The extent_map struct passed in will be inserted |
243 | * into the tree directly, with an additional reference taken, or a | 243 | * into the tree directly, with an additional reference taken, or a |
244 | * reference dropped if the merge attempt was successfull. | 244 | * reference dropped if the merge attempt was successful. |
245 | */ | 245 | */ |
246 | int add_extent_mapping(struct extent_map_tree *tree, | 246 | int add_extent_mapping(struct extent_map_tree *tree, |
247 | struct extent_map *em) | 247 | struct extent_map *em) |
@@ -335,7 +335,7 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, | |||
335 | goto out; | 335 | goto out; |
336 | } | 336 | } |
337 | if (IS_ERR(rb_node)) { | 337 | if (IS_ERR(rb_node)) { |
338 | em = ERR_PTR(PTR_ERR(rb_node)); | 338 | em = ERR_CAST(rb_node); |
339 | goto out; | 339 | goto out; |
340 | } | 340 | } |
341 | em = rb_entry(rb_node, struct extent_map, rb_node); | 341 | em = rb_entry(rb_node, struct extent_map, rb_node); |
@@ -384,7 +384,7 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree, | |||
384 | goto out; | 384 | goto out; |
385 | } | 385 | } |
386 | if (IS_ERR(rb_node)) { | 386 | if (IS_ERR(rb_node)) { |
387 | em = ERR_PTR(PTR_ERR(rb_node)); | 387 | em = ERR_CAST(rb_node); |
388 | goto out; | 388 | goto out; |
389 | } | 389 | } |
390 | em = rb_entry(rb_node, struct extent_map, rb_node); | 390 | em = rb_entry(rb_node, struct extent_map, rb_node); |