btrfs-progs: remove dead code that checks null eb
authorZach Brown <zab@redhat.com>
Tue, 22 Jan 2013 00:25:51 +0000 (16:25 -0800)
committerZach Brown <zab@redhat.com>
Wed, 6 Feb 2013 00:09:39 +0000 (16:09 -0800)
'next' can never be non-null in the body of these loops.  It's
initialized to NULL and the loop is terminated the moment it is set.

Signed-off-by: Zach Brown <zab@redhat.com>
ctree.c
restore.c

diff --git a/ctree.c b/ctree.c
index 2d86b1e..848722c 100644 (file)
--- a/ctree.c
+++ b/ctree.c
@@ -2872,9 +2872,6 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
                }
                slot--;
 
-               if (next)
-                       free_extent_buffer(next);
-
                next = read_node_slot(root, c, slot);
                break;
        }
@@ -2920,9 +2917,6 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
                        continue;
                }
 
-               if (next)
-                       free_extent_buffer(next);
-
                if (path->reada)
                        reada_for_search(root, path, level, slot, 0);
 
index ecabc3e..4853203 100644 (file)
--- a/restore.c
+++ b/restore.c
@@ -102,9 +102,6 @@ int next_leaf(struct btrfs_root *root, struct btrfs_path *path)
                        continue;
                }
 
-               if (next)
-                       free_extent_buffer(next);
-
                if (path->reada)
                        reada_for_search(root, path, level, slot, 0);