btrfs: Fix grossly misleading argument names in extent io search
[sfrench/cifs-2.6.git] / fs / btrfs / extent_io.c
index 67fec85c94d9641b6d6bfdc04e3b2ca57b5c792d..90ecce8572631472fc3846d7d61b4b474ee007cd 100644 (file)
@@ -281,8 +281,8 @@ do_insert:
 }
 
 static struct rb_node *__etree_search(struct extent_io_tree *tree, u64 offset,
-                                     struct rb_node **prev_ret,
                                      struct rb_node **next_ret,
+                                     struct rb_node **prev_ret,
                                      struct rb_node ***p_ret,
                                      struct rb_node **parent_ret)
 {
@@ -311,23 +311,23 @@ static struct rb_node *__etree_search(struct extent_io_tree *tree, u64 offset,
        if (parent_ret)
                *parent_ret = prev;
 
-       if (prev_ret) {
+       if (next_ret) {
                orig_prev = prev;
                while (prev && offset > prev_entry->end) {
                        prev = rb_next(prev);
                        prev_entry = rb_entry(prev, struct tree_entry, rb_node);
                }
-               *prev_ret = prev;
+               *next_ret = prev;
                prev = orig_prev;
        }
 
-       if (next_ret) {
+       if (prev_ret) {
                prev_entry = rb_entry(prev, struct tree_entry, rb_node);
                while (prev && offset < prev_entry->start) {
                        prev = rb_prev(prev);
                        prev_entry = rb_entry(prev, struct tree_entry, rb_node);
                }
-               *next_ret = prev;
+               *prev_ret = prev;
        }
        return NULL;
 }
@@ -338,12 +338,12 @@ tree_search_for_insert(struct extent_io_tree *tree,
                       struct rb_node ***p_ret,
                       struct rb_node **parent_ret)
 {
-       struct rb_node *prev = NULL;
+       struct rb_node *next= NULL;
        struct rb_node *ret;
 
-       ret = __etree_search(tree, offset, &prev, NULL, p_ret, parent_ret);
+       ret = __etree_search(tree, offset, &next, NULL, p_ret, parent_ret);
        if (!ret)
-               return prev;
+               return next;
        return ret;
 }