Btrfs: remove assertion when searching for a key in a node/leaf
[sfrench/cifs-2.6.git] / fs / btrfs / ctree.c
index 399b9c5182d5564f0749eca179afce26f7e39f0c..324df36d28bf7d8da2b7f66186819a6e0a92968f 100644 (file)
@@ -2544,26 +2544,6 @@ done:
        return ret;
 }
 
-static void key_search_validate(struct extent_buffer *b,
-                               const struct btrfs_key *key,
-                               int level)
-{
-#ifdef CONFIG_BTRFS_ASSERT
-       struct btrfs_disk_key disk_key;
-
-       btrfs_cpu_key_to_disk(&disk_key, key);
-
-       if (level == 0)
-               ASSERT(!memcmp_extent_buffer(b, &disk_key,
-                   offsetof(struct btrfs_leaf, items[0].key),
-                   sizeof(disk_key)));
-       else
-               ASSERT(!memcmp_extent_buffer(b, &disk_key,
-                   offsetof(struct btrfs_node, ptrs[0].key),
-                   sizeof(disk_key)));
-#endif
-}
-
 static int key_search(struct extent_buffer *b, const struct btrfs_key *key,
                      int level, int *prev_cmp, int *slot)
 {
@@ -2572,7 +2552,6 @@ static int key_search(struct extent_buffer *b, const struct btrfs_key *key,
                return *prev_cmp;
        }
 
-       key_search_validate(b, key, level);
        *slot = 0;
 
        return 0;