Lines Matching refs:item

21  * Read a root item from the tree. In case we detect a root item smaller then
25 * kernel that was not aware of the root item structure change.
28 struct btrfs_root_item *item)
34 read_extent_buffer(eb, item, btrfs_item_ptr_offset(eb, slot),
35 min_t(u32, len, sizeof(*item)));
36 if (len < sizeof(*item))
38 if (!need_reset && btrfs_root_generation(item)
39 != btrfs_root_generation_v2(item)) {
40 if (btrfs_root_generation_v2(item) != 0) {
42 "mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields.");
48 memset_startat(item, 0, generation_v2);
49 generate_random_guid(item->uuid);
58 * root_item: the root item of the tree we look for
110 void btrfs_set_root_node(struct btrfs_root_item *item,
113 btrfs_set_root_bytenr(item, node->start);
114 btrfs_set_root_level(item, btrfs_header_level(node));
115 btrfs_set_root_generation(item, btrfs_header_generation(node));
119 * copy the data in 'item' into the btree
123 *item)
157 * If this is the first time we update the root item which originated
158 * from an older kernel, we need to enlarge the item size to make room
161 if (old_len < sizeof(*item)) {
177 key, sizeof(*item));
191 btrfs_set_root_generation_v2(item, btrfs_root_generation(item));
193 write_extent_buffer(l, item, ptr, sizeof(*item));
201 const struct btrfs_key *key, struct btrfs_root_item *item)
206 btrfs_set_root_generation_v2(item, btrfs_root_generation(item));
207 return btrfs_insert_item(trans, root, key, item, sizeof(*item));
270 "Failed to start trans to delete orphan item");
278 "Failed to delete root orphan item");
311 /* drop the root item for 'key' from the tree root */
392 * add a btrfs_root_ref item. type is either BTRFS_ROOT_REF_KEY
476 struct btrfs_root_item *item = &root->root_item;
481 btrfs_set_root_ctransid(item, trans->transid);
482 btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec);
483 btrfs_set_stack_timespec_nsec(&item->ctime, ct.tv_nsec);