#include "backref.h"
#include "ulist.h"
#include "transaction.h"
+#include "internal.h"
#define pr_debug(...) do { } while (0)
eb = path->nodes[level];
while (!eb) {
- WARN_ON(!level);
if (!level) {
ret = 1;
+ WARN_ON(1);
goto out;
}
level--;
continue;
BUG_ON(!ref->wanted_disk_byte);
eb = read_tree_block(fs_info->tree_root, ref->wanted_disk_byte,
- fs_info->tree_root->leafsize, 0);
+ fs_info->tree_root->nodesize, 0);
if (!extent_buffer_uptodate(eb)) {
free_extent_buffer(eb);
return -EIO;
ref->level == 0) {
u32 bsz;
struct extent_buffer *eb;
- bsz = btrfs_level_size(fs_info->extent_root,
- ref->level);
+ bsz = fs_info->extent_root->nodesize;
eb = read_tree_block(fs_info->extent_root,
ref->parent, bsz, 0);
if (!extent_buffer_uptodate(eb)) {
}
btrfs_item_key_to_cpu(path->nodes[0], found_key, path->slots[0]);
if (found_key->type == BTRFS_METADATA_ITEM_KEY)
- size = fs_info->extent_root->leafsize;
+ size = fs_info->extent_root->nodesize;
else if (found_key->type == BTRFS_EXTENT_ITEM_KEY)
size = found_key->offset;
logical, logical - found_key->objectid, found_key->objectid,
found_key->offset, flags, item_size);
- WARN_ON(!flags_ret);
if (flags_ret) {
if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK)
*flags_ret = BTRFS_EXTENT_FLAG_TREE_BLOCK;
else
BUG_ON(1);
return 0;
+ } else {
+ WARN_ON(1);
+ return -EIO;
}
-
- return -EIO;
}
/*
* is has been created large enough. each path is zero-terminated and accessed
* from ipath->fspath->val[i].
* when it returns, there are ipath->fspath->elem_cnt number of paths available
- * in ipath->fspath->val[]. when the allocated space wasn't sufficient, the
- * number of missed paths in recored in ipath->fspath->elem_missed, otherwise,
+ * in ipath->fspath->val[]. When the allocated space wasn't sufficient, the
+ * number of missed paths is recorded in ipath->fspath->elem_missed, otherwise,
* it's zero. ipath->fspath->bytes_missing holds the number of bytes that would
* have been needed to return all paths.
*/