#include "print-tree.h"
#include "utils.h"
#include "ulist.h"
+#include "rbtree-utils.h"
#include "qgroup-verify.h"
* finding roots to account against.
*
* An implied ref is when a tree block has refs on it that may not
- * exist in any of it's child nodes. Even though the refs might not
+ * exist in any of its child nodes. Even though the refs might not
* exist further down the tree, the fact that our interior node has a
- * ref means we need to account anything below it to all it's roots.
+ * ref means we need to account anything below it to all its roots.
*/
struct ulist *tree_blocks = NULL; /* unode->val = bytenr, ->aux
* = tree_block pointer */
static inline struct tree_block *unode_tree_block(struct ulist_node *unode)
{
- return (struct tree_block *)unode->aux;
+ return u64_to_ptr(unode->aux);
}
static inline u64 unode_bytenr(struct ulist_node *unode)
{
if (block) {
block->num_bytes = num_bytes;
block->level = level;
- if (ulist_add(tree_blocks, bytenr, (unsigned long long)block, 0) >= 0)
+ if (ulist_add(tree_blocks, bytenr, ptr_to_u64(block), 0) >= 0)
return 0;
free(block);
}
// bytenr, num_bytes, ref_parent);
eb = read_tree_block(root, bytenr, num_bytes, 0);
- if (!eb)
+ if (!extent_buffer_uptodate(eb))
return -EIO;
ret = 0;
struct tree_block *block)
{
int ret;
- u64 root_bytenr = resolve_one_root(bytenr);
+ u64 root_id = resolve_one_root(bytenr);
struct btrfs_root *root;
struct btrfs_key key;
- key.objectid = root_bytenr;
+ key.objectid = root_id;
key.type = BTRFS_ROOT_ITEM_KEY;
key.offset = (u64)-1;