Lines Matching refs:item
16 * Read a root item from the tree. In case we detect a root item smaller then
20 * kernel that was not aware of the root item structure change.
23 struct btrfs_root_item *item)
29 read_extent_buffer(eb, item, btrfs_item_ptr_offset(eb, slot),
30 min_t(u32, len, sizeof(*item)));
31 if (len < sizeof(*item))
33 if (!need_reset && btrfs_root_generation(item)
34 != btrfs_root_generation_v2(item)) {
35 if (btrfs_root_generation_v2(item) != 0) {
37 "mismatching generation and generation_v2 found in root item. This root was probably mounted with an older kernel. Resetting all new fields.");
42 memset(&item->generation_v2, 0,
43 sizeof(*item) - offsetof(struct btrfs_root_item,
46 generate_random_guid(item->uuid);
55 * root_item: the root item of the tree we look for
107 void btrfs_set_root_node(struct btrfs_root_item *item,
110 btrfs_set_root_bytenr(item, node->start);
111 btrfs_set_root_level(item, btrfs_header_level(node));
112 btrfs_set_root_generation(item, btrfs_header_generation(node));
116 * copy the data in 'item' into the btree
120 *item)
154 * If this is the first time we update the root item which originated
155 * from an older kernel, we need to enlarge the item size to make room
158 if (old_len < sizeof(*item)) {
174 key, sizeof(*item));
188 btrfs_set_root_generation_v2(item, btrfs_root_generation(item));
190 write_extent_buffer(l, item, ptr, sizeof(*item));
198 const struct btrfs_key *key, struct btrfs_root_item *item)
203 btrfs_set_root_generation_v2(item, btrfs_root_generation(item));
204 return btrfs_insert_item(trans, root, key, item, sizeof(*item));
267 "Failed to start trans to delete orphan item");
275 "Failed to delete root orphan item");
293 /* drop the root item for 'key' from the tree root */
377 * add a btrfs_root_ref item. type is either BTRFS_ROOT_REF_KEY
461 struct btrfs_root_item *item = &root->root_item;
466 btrfs_set_root_ctransid(item, trans->transid);
467 btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec);
468 btrfs_set_stack_timespec_nsec(&item->ctime, ct.tv_nsec);