Lines Matching refs:leaf
475 struct extent_buffer *leaf) in check_leaf() argument
479 u32 nritems = btrfs_header_nritems(leaf); in check_leaf()
486 if (btrfs_item_offset_nr(leaf, 0) + btrfs_item_size_nr(leaf, 0) != in check_leaf()
488 CORRUPT("invalid item offset size pair", leaf, root, 0); in check_leaf()
500 btrfs_item_key_to_cpu(leaf, &leaf_key, slot); in check_leaf()
501 btrfs_item_key_to_cpu(leaf, &key, slot + 1); in check_leaf()
505 CORRUPT("bad key order", leaf, root, slot); in check_leaf()
514 if (btrfs_item_offset_nr(leaf, slot) != in check_leaf()
515 btrfs_item_end_nr(leaf, slot + 1)) { in check_leaf()
516 CORRUPT("slot offset bad", leaf, root, slot); in check_leaf()
525 if (btrfs_item_end_nr(leaf, slot) > in check_leaf()
527 CORRUPT("slot end outside of leaf", leaf, root, slot); in check_leaf()
1232 struct extent_buffer *leaf; in alloc_log_tree() local
1253 leaf = btrfs_alloc_free_block(trans, root, root->leafsize, 0, in alloc_log_tree()
1256 if (IS_ERR(leaf)) { in alloc_log_tree()
1258 return ERR_CAST(leaf); in alloc_log_tree()
1261 memset_extent_buffer(leaf, 0, 0, sizeof(struct btrfs_header)); in alloc_log_tree()
1262 btrfs_set_header_bytenr(leaf, leaf->start); in alloc_log_tree()
1263 btrfs_set_header_generation(leaf, trans->transid); in alloc_log_tree()
1264 btrfs_set_header_backref_rev(leaf, BTRFS_MIXED_BACKREF_REV); in alloc_log_tree()
1265 btrfs_set_header_owner(leaf, BTRFS_TREE_LOG_OBJECTID); in alloc_log_tree()
1266 root->node = leaf; in alloc_log_tree()