]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/btrfs/extent_map.c
Merge branch 'master' into tk71
[mv-sheeva.git] / fs / btrfs / extent_map.c
index 454ca52d6451b649b78b48cba908f3fd1eb2bada..2b6c12e983b34a76e48242af2b003fa5b7d2d821 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/hardirq.h>
+#include "ctree.h"
 #include "extent_map.h"
 
 
@@ -50,10 +51,11 @@ struct extent_map *alloc_extent_map(gfp_t mask)
 {
        struct extent_map *em;
        em = kmem_cache_alloc(extent_map_cache, mask);
-       if (!em || IS_ERR(em))
-               return em;
+       if (!em)
+               return NULL;
        em->in_tree = 0;
        em->flags = 0;
+       em->compress_type = BTRFS_COMPRESS_NONE;
        atomic_set(&em->refs, 1);
        return em;
 }
@@ -335,7 +337,7 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree,
                goto out;
        }
        if (IS_ERR(rb_node)) {
-               em = ERR_PTR(PTR_ERR(rb_node));
+               em = ERR_CAST(rb_node);
                goto out;
        }
        em = rb_entry(rb_node, struct extent_map, rb_node);
@@ -384,7 +386,7 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree,
                goto out;
        }
        if (IS_ERR(rb_node)) {
-               em = ERR_PTR(PTR_ERR(rb_node));
+               em = ERR_CAST(rb_node);
                goto out;
        }
        em = rb_entry(rb_node, struct extent_map, rb_node);