nfsd4: fold release_session into expire_client
[safe/jmp/linux-2.6] / fs / btrfs / free-space-cache.c
index 5c2caad..f488fac 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/pagemap.h>
 #include <linux/sched.h>
+#include <linux/slab.h>
 #include <linux/math64.h>
 #include "ctree.h"
 #include "free-space-cache.h"
@@ -870,7 +871,7 @@ __btrfs_return_cluster_to_free_space(
                tree_insert_offset(&block_group->free_space_offset,
                                   entry->offset, &entry->offset_index, 0);
        }
-       cluster->root.rb_node = NULL;
+       cluster->root = RB_ROOT;
 
 out:
        spin_unlock(&cluster->lock);
@@ -1296,7 +1297,7 @@ again:
                        window_start = entry->offset;
                        window_free = entry->bytes;
                        last = entry;
-                       max_extent = 0;
+                       max_extent = entry->bytes;
                } else {
                        last = next;
                        window_free += next->bytes;
@@ -1355,7 +1356,7 @@ void btrfs_init_free_cluster(struct btrfs_free_cluster *cluster)
 {
        spin_lock_init(&cluster->lock);
        spin_lock_init(&cluster->refill_lock);
-       cluster->root.rb_node = NULL;
+       cluster->root = RB_ROOT;
        cluster->max_size = 0;
        cluster->points_to_bitmap = false;
        INIT_LIST_HEAD(&cluster->block_group_list);