Lines Matching full:root
51 * btrfs_paths remember the path taken from the root down to the leaf.
91 * The state of btrfs root
97 * first time the root is added to each transaction. So IN_TRANS_SETUP
103 * Set if tree blocks of this root can be shared by other roots.
138 /* Mark dead root stored on device whose cleanup needs to be resumed */
140 /* The root has a log tree. Used for subvolume roots and the tree root. */
144 /* We started the orphan cleanup for this root. */
146 /* This root has a drop operation that was started previously. */
148 /* This reloc root needs to have its buffers lockdep class reset. */
165 * and for the extent tree extent_root root.
191 /* Used only for log trees of subvolumes, not for the log root tree */
194 /* Used only for log trees of subvolumes, not for the log root tree */
239 * right now this just gets used so that a root has its own devid
275 * Not empty if this subvolume root has gone through tree block swap
289 * destination inode belonging to this root. Protected by the lock
313 /* Used in simple quotas, track root during relocation. */
325 static inline bool btrfs_root_readonly(const struct btrfs_root *root) in btrfs_root_readonly() argument
328 return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0; in btrfs_root_readonly()
331 static inline bool btrfs_root_dead(const struct btrfs_root *root) in btrfs_root_dead() argument
334 return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_DEAD)) != 0; in btrfs_root_dead()
337 static inline u64 btrfs_root_id(const struct btrfs_root *root) in btrfs_root_id() argument
339 return root->root_key.objectid; in btrfs_root_id()
342 static inline int btrfs_get_root_log_transid(const struct btrfs_root *root) in btrfs_get_root_log_transid() argument
344 return READ_ONCE(root->log_transid); in btrfs_get_root_log_transid()
347 static inline void btrfs_set_root_log_transid(struct btrfs_root *root, int log_transid) in btrfs_set_root_log_transid() argument
349 WRITE_ONCE(root->log_transid, log_transid); in btrfs_set_root_log_transid()
352 static inline int btrfs_get_root_last_log_commit(const struct btrfs_root *root) in btrfs_get_root_last_log_commit() argument
354 return READ_ONCE(root->last_log_commit); in btrfs_get_root_last_log_commit()
357 static inline void btrfs_set_root_last_log_commit(struct btrfs_root *root, int commit_id) in btrfs_set_root_last_log_commit() argument
359 WRITE_ONCE(root->last_log_commit, commit_id); in btrfs_set_root_last_log_commit()
362 static inline u64 btrfs_get_root_last_trans(const struct btrfs_root *root) in btrfs_get_root_last_trans() argument
364 return READ_ONCE(root->last_trans); in btrfs_get_root_last_trans()
367 static inline void btrfs_set_root_last_trans(struct btrfs_root *root, u64 transid) in btrfs_set_root_last_trans() argument
369 WRITE_ONCE(root->last_trans, transid); in btrfs_set_root_last_trans()
373 * Return the generation this root started with.
375 * Every normal root that is created with root->root_key.offset set to it's
380 * tree root. Thankfully we copy the root item of the owning tree root, which
382 * return that if this is a TREE_RELOC root.
384 static inline u64 btrfs_root_origin_generation(const struct btrfs_root *root) in btrfs_root_origin_generation() argument
386 if (btrfs_root_id(root) == BTRFS_TREE_RELOC_OBJECTID) in btrfs_root_origin_generation()
387 return btrfs_root_last_snapshot(&root->root_item); in btrfs_root_origin_generation()
388 return root->root_key.offset; in btrfs_root_origin_generation()
545 int btrfs_previous_item(struct btrfs_root *root,
548 int btrfs_previous_extent_item(struct btrfs_root *root,
553 struct extent_buffer *btrfs_root_node(struct btrfs_root *root);
554 int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
557 int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
564 struct btrfs_root *root, struct extent_buffer *buf,
569 struct btrfs_root *root,
576 struct btrfs_root *root,
580 struct btrfs_root *root,
582 int btrfs_del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,
589 struct btrfs_root *root,
594 struct btrfs_root *root,
599 int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,
602 int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
604 int btrfs_search_slot_for_read(struct btrfs_root *root,
613 int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
616 struct btrfs_root *root, in btrfs_del_item() argument
619 return btrfs_del_items(trans, root, path, path->slots[0], 1); in btrfs_del_item()
649 struct btrfs_root *root,
653 int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root,
656 struct btrfs_root *root,
661 struct btrfs_root *root, in btrfs_insert_empty_item() argument
673 return btrfs_insert_empty_items(trans, root, path, &batch); in btrfs_insert_empty_item()
676 int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
679 int btrfs_search_backwards(struct btrfs_root *root, struct btrfs_key *key,
682 int btrfs_get_next_valid_item(struct btrfs_root *root, struct btrfs_key *key,
686 * Search in @root for a given @key, and store the slot found in @found_key.
688 * @root: The root node of the tree.
704 #define btrfs_for_each_slot(root, key, found_key, path, iter_ret) \ argument
705 for (iter_ret = btrfs_search_slot(NULL, (root), (key), (path), 0, 0); \
707 (iter_ret = btrfs_get_next_valid_item((root), (found_key), (path))) == 0; \
711 int btrfs_next_old_item(struct btrfs_root *root, struct btrfs_path *path, u64 time_seq);
719 static inline int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) in btrfs_next_leaf() argument
721 return btrfs_next_old_leaf(root, path, 0); in btrfs_next_leaf()
724 static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p) in btrfs_next_item() argument
726 return btrfs_next_old_item(root, p, 0); in btrfs_next_item()
739 static inline bool btrfs_is_data_reloc_root(const struct btrfs_root *root) in btrfs_is_data_reloc_root() argument
741 return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID; in btrfs_is_data_reloc_root()