/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2007 Oracle. All rights reserved.3*/45#ifndef BTRFS_CTREE_H6#define BTRFS_CTREE_H78#include <linux/cleanup.h>9#include <linux/spinlock.h>10#include <linux/rbtree.h>11#include <linux/mutex.h>12#include <linux/wait.h>13#include <linux/list.h>14#include <linux/atomic.h>15#include <linux/xarray.h>16#include <linux/refcount.h>17#include <uapi/linux/btrfs_tree.h>18#include "locking.h"19#include "fs.h"20#include "accessors.h"21#include "extent-io-tree.h"2223struct extent_buffer;24struct btrfs_block_rsv;25struct btrfs_trans_handle;26struct btrfs_block_group;2728/* Read ahead values for struct btrfs_path.reada */29enum {30READA_NONE,31READA_BACK,32READA_FORWARD,33/*34* Similar to READA_FORWARD but unlike it:35*36* 1) It will trigger readahead even for leaves that are not close to37* each other on disk;38* 2) It also triggers readahead for nodes;39* 3) During a search, even when a node or leaf is already in memory, it40* will still trigger readahead for other nodes and leaves that follow41* it.42*43* This is meant to be used only when we know we are iterating over the44* entire tree or a very large part of it.45*/46READA_FORWARD_ALWAYS,47};4849/*50* btrfs_paths remember the path taken from the root down to the leaf.51* level 0 is always the leaf, and nodes[1...BTRFS_MAX_LEVEL] will point52* to any other levels that are present.53*54* The slots array records the index of the item or block pointer55* used while walking the tree.56*/57struct btrfs_path {58struct extent_buffer *nodes[BTRFS_MAX_LEVEL];59int slots[BTRFS_MAX_LEVEL];60/* if there is real range locking, this locks field will change */61u8 locks[BTRFS_MAX_LEVEL];62u8 reada;63u8 lowest_level;6465/*66* set by btrfs_split_item, tells search_slot to keep all locks67* and to force calls to keep space in the nodes68*/69unsigned int search_for_split:1;70/* Keep some upper locks as we walk down. */71unsigned int keep_locks:1;72unsigned int skip_locking:1;73unsigned int search_commit_root:1;74unsigned int need_commit_sem:1;75unsigned int skip_release_on_error:1;76/*77* Indicate that new item (btrfs_search_slot) is extending already78* existing item and ins_len contains only the data size and not item79* header (ie. sizeof(struct btrfs_item) is not included).80*/81unsigned int search_for_extension:1;82/* Stop search if any locks need to be taken (for read) */83unsigned int nowait:1;84};8586#define BTRFS_PATH_AUTO_FREE(path_name) \87struct btrfs_path *path_name __free(btrfs_free_path) = NULL8889/*90* The state of btrfs root91*/92enum {93/*94* btrfs_record_root_in_trans is a multi-step process, and it can race95* with the balancing code. But the race is very small, and only the96* first time the root is added to each transaction. So IN_TRANS_SETUP97* is used to tell us when more checks are required98*/99BTRFS_ROOT_IN_TRANS_SETUP,100101/*102* Set if tree blocks of this root can be shared by other roots.103* Only subvolume trees and their reloc trees have this bit set.104* Conflicts with TRACK_DIRTY bit.105*106* This affects two things:107*108* - How balance works109* For shareable roots, we need to use reloc tree and do path110* replacement for balance, and need various pre/post hooks for111* snapshot creation to handle them.112*113* While for non-shareable trees, we just simply do a tree search114* with COW.115*116* - How dirty roots are tracked117* For shareable roots, btrfs_record_root_in_trans() is needed to118* track them, while non-subvolume roots have TRACK_DIRTY bit, they119* don't need to set this manually.120*/121BTRFS_ROOT_SHAREABLE,122BTRFS_ROOT_TRACK_DIRTY,123BTRFS_ROOT_IN_RADIX,124BTRFS_ROOT_ORPHAN_ITEM_INSERTED,125BTRFS_ROOT_DEFRAG_RUNNING,126BTRFS_ROOT_FORCE_COW,127BTRFS_ROOT_MULTI_LOG_TASKS,128BTRFS_ROOT_DIRTY,129BTRFS_ROOT_DELETING,130131/*132* Reloc tree is orphan, only kept here for qgroup delayed subtree scan133*134* Set for the subvolume tree owning the reloc tree.135*/136BTRFS_ROOT_DEAD_RELOC_TREE,137/* Mark dead root stored on device whose cleanup needs to be resumed */138BTRFS_ROOT_DEAD_TREE,139/* The root has a log tree. Used for subvolume roots and the tree root. */140BTRFS_ROOT_HAS_LOG_TREE,141/* Qgroup flushing is in progress */142BTRFS_ROOT_QGROUP_FLUSHING,143/* We started the orphan cleanup for this root. */144BTRFS_ROOT_ORPHAN_CLEANUP,145/* This root has a drop operation that was started previously. */146BTRFS_ROOT_UNFINISHED_DROP,147/* This reloc root needs to have its buffers lockdep class reset. */148BTRFS_ROOT_RESET_LOCKDEP_CLASS,149};150151/*152* Record swapped tree blocks of a subvolume tree for delayed subtree trace153* code. For detail check comment in fs/btrfs/qgroup.c.154*/155struct btrfs_qgroup_swapped_blocks {156spinlock_t lock;157/* RM_EMPTY_ROOT() of above blocks[] */158bool swapped;159struct rb_root blocks[BTRFS_MAX_LEVEL];160};161162/*163* in ram representation of the tree. extent_root is used for all allocations164* and for the extent tree extent_root root.165*/166struct btrfs_root {167struct rb_node rb_node;168169struct extent_buffer *node;170171struct extent_buffer *commit_root;172struct btrfs_root *log_root;173struct btrfs_root *reloc_root;174175unsigned long state;176struct btrfs_root_item root_item;177struct btrfs_key root_key;178struct btrfs_fs_info *fs_info;179struct extent_io_tree dirty_log_pages;180181struct mutex objectid_mutex;182183spinlock_t accounting_lock;184struct btrfs_block_rsv *block_rsv;185186struct mutex log_mutex;187wait_queue_head_t log_writer_wait;188wait_queue_head_t log_commit_wait[2];189struct list_head log_ctxs[2];190/* Used only for log trees of subvolumes, not for the log root tree */191atomic_t log_writers;192atomic_t log_commit[2];193/* Used only for log trees of subvolumes, not for the log root tree */194atomic_t log_batch;195/*196* Protected by the 'log_mutex' lock but can be read without holding197* that lock to avoid unnecessary lock contention, in which case it198* should be read using btrfs_get_root_log_transid() except if it's a199* log tree in which case it can be directly accessed. Updates to this200* field should always use btrfs_set_root_log_transid(), except for log201* trees where the field can be updated directly.202*/203int log_transid;204/* No matter the commit succeeds or not*/205int log_transid_committed;206/*207* Just be updated when the commit succeeds. Use208* btrfs_get_root_last_log_commit() and btrfs_set_root_last_log_commit()209* to access this field.210*/211int last_log_commit;212pid_t log_start_pid;213214u64 last_trans;215216u64 free_objectid;217218struct btrfs_key defrag_progress;219struct btrfs_key defrag_max;220221/* The dirty list is only used by non-shareable roots */222struct list_head dirty_list;223224struct list_head root_list;225226/* Xarray that keeps track of in-memory inodes. */227struct xarray inodes;228229/* Xarray that keeps track of delayed nodes of every inode. */230struct xarray delayed_nodes;231/*232* right now this just gets used so that a root has its own devid233* for stat. It may be used for more later234*/235dev_t anon_dev;236237spinlock_t root_item_lock;238refcount_t refs;239240struct mutex delalloc_mutex;241spinlock_t delalloc_lock;242/*243* all of the inodes that have delalloc bytes. It is possible for244* this list to be empty even when there is still dirty data=ordered245* extents waiting to finish IO.246*/247struct list_head delalloc_inodes;248struct list_head delalloc_root;249u64 nr_delalloc_inodes;250251struct mutex ordered_extent_mutex;252/*253* this is used by the balancing code to wait for all the pending254* ordered extents255*/256spinlock_t ordered_extent_lock;257258/*259* all of the data=ordered extents pending writeback260* these can span multiple transactions and basically include261* every dirty data page that isn't from nodatacow262*/263struct list_head ordered_extents;264struct list_head ordered_root;265u64 nr_ordered_extents;266267/*268* Not empty if this subvolume root has gone through tree block swap269* (relocation)270*271* Will be used by reloc_control::dirty_subvol_roots.272*/273struct list_head reloc_dirty_list;274275/*276* Number of currently running SEND ioctls to prevent277* manipulation with the read-only status via SUBVOL_SETFLAGS278*/279int send_in_progress;280/*281* Number of currently running deduplication operations that have a282* destination inode belonging to this root. Protected by the lock283* root_item_lock.284*/285int dedupe_in_progress;286/* For exclusion of snapshot creation and nocow writes */287struct btrfs_drew_lock snapshot_lock;288289atomic_t snapshot_force_cow;290291/* For qgroup metadata reserved space */292spinlock_t qgroup_meta_rsv_lock;293u64 qgroup_meta_rsv_pertrans;294u64 qgroup_meta_rsv_prealloc;295wait_queue_head_t qgroup_flush_wait;296297/* Number of active swapfiles */298atomic_t nr_swapfiles;299300/* Record pairs of swapped blocks for qgroup */301struct btrfs_qgroup_swapped_blocks swapped_blocks;302303/* Used only by log trees, when logging csum items */304struct extent_io_tree log_csum_range;305306/* Used in simple quotas, track root during relocation. */307u64 relocation_src_root;308309#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS310u64 alloc_bytenr;311#endif312313#ifdef CONFIG_BTRFS_DEBUG314struct list_head leak_list;315#endif316};317318static inline bool btrfs_root_readonly(const struct btrfs_root *root)319{320/* Byte-swap the constant at compile time, root_item::flags is LE */321return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0;322}323324static inline bool btrfs_root_dead(const struct btrfs_root *root)325{326/* Byte-swap the constant at compile time, root_item::flags is LE */327return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_DEAD)) != 0;328}329330static inline u64 btrfs_root_id(const struct btrfs_root *root)331{332return root->root_key.objectid;333}334335static inline int btrfs_get_root_log_transid(const struct btrfs_root *root)336{337return READ_ONCE(root->log_transid);338}339340static inline void btrfs_set_root_log_transid(struct btrfs_root *root, int log_transid)341{342WRITE_ONCE(root->log_transid, log_transid);343}344345static inline int btrfs_get_root_last_log_commit(const struct btrfs_root *root)346{347return READ_ONCE(root->last_log_commit);348}349350static inline void btrfs_set_root_last_log_commit(struct btrfs_root *root, int commit_id)351{352WRITE_ONCE(root->last_log_commit, commit_id);353}354355static inline u64 btrfs_get_root_last_trans(const struct btrfs_root *root)356{357return READ_ONCE(root->last_trans);358}359360static inline void btrfs_set_root_last_trans(struct btrfs_root *root, u64 transid)361{362WRITE_ONCE(root->last_trans, transid);363}364365/*366* Return the generation this root started with.367*368* Every normal root that is created with root->root_key.offset set to it's369* originating generation. If it is a snapshot it is the generation when the370* snapshot was created.371*372* However for TREE_RELOC roots root_key.offset is the objectid of the owning373* tree root. Thankfully we copy the root item of the owning tree root, which374* has it's last_snapshot set to what we would have root_key.offset set to, so375* return that if this is a TREE_RELOC root.376*/377static inline u64 btrfs_root_origin_generation(const struct btrfs_root *root)378{379if (btrfs_root_id(root) == BTRFS_TREE_RELOC_OBJECTID)380return btrfs_root_last_snapshot(&root->root_item);381return root->root_key.offset;382}383384/*385* Structure that conveys information about an extent that is going to replace386* all the extents in a file range.387*/388struct btrfs_replace_extent_info {389u64 disk_offset;390u64 disk_len;391u64 data_offset;392u64 data_len;393u64 file_offset;394/* Pointer to a file extent item of type regular or prealloc. */395char *extent_buf;396/*397* Set to true when attempting to replace a file range with a new extent398* described by this structure, set to false when attempting to clone an399* existing extent into a file range.400*/401bool is_new_extent;402/* Indicate if we should update the inode's mtime and ctime. */403bool update_times;404/* Meaningful only if is_new_extent is true. */405int qgroup_reserved;406/*407* Meaningful only if is_new_extent is true.408* Used to track how many extent items we have already inserted in a409* subvolume tree that refer to the extent described by this structure,410* so that we know when to create a new delayed ref or update an existing411* one.412*/413int insertions;414};415416/* Arguments for btrfs_drop_extents() */417struct btrfs_drop_extents_args {418/* Input parameters */419420/*421* If NULL, btrfs_drop_extents() will allocate and free its own path.422* If 'replace_extent' is true, this must not be NULL. Also the path423* is always released except if 'replace_extent' is true and424* btrfs_drop_extents() sets 'extent_inserted' to true, in which case425* the path is kept locked.426*/427struct btrfs_path *path;428/* Start offset of the range to drop extents from */429u64 start;430/* End (exclusive, last byte + 1) of the range to drop extents from */431u64 end;432/* If true drop all the extent maps in the range */433bool drop_cache;434/*435* If true it means we want to insert a new extent after dropping all436* the extents in the range. If this is true, the 'extent_item_size'437* parameter must be set as well and the 'extent_inserted' field will438* be set to true by btrfs_drop_extents() if it could insert the new439* extent.440* Note: when this is set to true the path must not be NULL.441*/442bool replace_extent;443/*444* Used if 'replace_extent' is true. Size of the file extent item to445* insert after dropping all existing extents in the range446*/447u32 extent_item_size;448449/* Output parameters */450451/*452* Set to the minimum between the input parameter 'end' and the end453* (exclusive, last byte + 1) of the last dropped extent. This is always454* set even if btrfs_drop_extents() returns an error.455*/456u64 drop_end;457/*458* The number of allocated bytes found in the range. This can be smaller459* than the range's length when there are holes in the range.460*/461u64 bytes_found;462/*463* Only set if 'replace_extent' is true. Set to true if we were able464* to insert a replacement extent after dropping all extents in the465* range, otherwise set to false by btrfs_drop_extents().466* Also, if btrfs_drop_extents() has set this to true it means it467* returned with the path locked, otherwise if it has set this to468* false it has returned with the path released.469*/470bool extent_inserted;471};472473struct btrfs_file_private {474void *filldir_buf;475u64 last_index;476struct extent_state *llseek_cached_state;477/* Task that allocated this structure. */478struct task_struct *owner_task;479};480481static inline u32 BTRFS_LEAF_DATA_SIZE(const struct btrfs_fs_info *info)482{483return info->nodesize - sizeof(struct btrfs_header);484}485486static inline u32 BTRFS_MAX_ITEM_SIZE(const struct btrfs_fs_info *info)487{488return BTRFS_LEAF_DATA_SIZE(info) - sizeof(struct btrfs_item);489}490491static inline u32 BTRFS_NODEPTRS_PER_BLOCK(const struct btrfs_fs_info *info)492{493return BTRFS_LEAF_DATA_SIZE(info) / sizeof(struct btrfs_key_ptr);494}495496static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info)497{498return BTRFS_MAX_ITEM_SIZE(info) - sizeof(struct btrfs_dir_item);499}500501int __init btrfs_ctree_init(void);502void __cold btrfs_ctree_exit(void);503504int btrfs_bin_search(const struct extent_buffer *eb, int first_slot,505const struct btrfs_key *key, int *slot);506507int __pure btrfs_comp_cpu_keys(const struct btrfs_key *k1, const struct btrfs_key *k2);508509#ifdef __LITTLE_ENDIAN510511/*512* Compare two keys, on little-endian the disk order is same as CPU order and513* we can avoid the conversion.514*/515static inline int btrfs_comp_keys(const struct btrfs_disk_key *disk_key,516const struct btrfs_key *k2)517{518const struct btrfs_key *k1 = (const struct btrfs_key *)disk_key;519520return btrfs_comp_cpu_keys(k1, k2);521}522523#else524525/* Compare two keys in a memcmp fashion. */526static inline int btrfs_comp_keys(const struct btrfs_disk_key *disk,527const struct btrfs_key *k2)528{529struct btrfs_key k1;530531btrfs_disk_key_to_cpu(&k1, disk);532533return btrfs_comp_cpu_keys(&k1, k2);534}535536#endif537538int btrfs_previous_item(struct btrfs_root *root,539struct btrfs_path *path, u64 min_objectid,540int type);541int btrfs_previous_extent_item(struct btrfs_root *root,542struct btrfs_path *path, u64 min_objectid);543void btrfs_set_item_key_safe(struct btrfs_trans_handle *trans,544const struct btrfs_path *path,545const struct btrfs_key *new_key);546struct extent_buffer *btrfs_root_node(struct btrfs_root *root);547int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,548struct btrfs_key *key, int lowest_level,549u64 min_trans);550int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,551struct btrfs_path *path,552u64 min_trans);553struct extent_buffer *btrfs_read_node_slot(struct extent_buffer *parent,554int slot);555556int btrfs_cow_block(struct btrfs_trans_handle *trans,557struct btrfs_root *root, struct extent_buffer *buf,558struct extent_buffer *parent, int parent_slot,559struct extent_buffer **cow_ret,560enum btrfs_lock_nesting nest);561int btrfs_force_cow_block(struct btrfs_trans_handle *trans,562struct btrfs_root *root,563struct extent_buffer *buf,564struct extent_buffer *parent, int parent_slot,565struct extent_buffer **cow_ret,566u64 search_start, u64 empty_size,567enum btrfs_lock_nesting nest);568int btrfs_copy_root(struct btrfs_trans_handle *trans,569struct btrfs_root *root,570struct extent_buffer *buf,571struct extent_buffer **cow_ret, u64 new_root_objectid);572bool btrfs_block_can_be_shared(const struct btrfs_trans_handle *trans,573const struct btrfs_root *root,574const struct extent_buffer *buf);575int btrfs_del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,576struct btrfs_path *path, int level, int slot);577void btrfs_extend_item(struct btrfs_trans_handle *trans,578const struct btrfs_path *path, u32 data_size);579void btrfs_truncate_item(struct btrfs_trans_handle *trans,580const struct btrfs_path *path, u32 new_size, int from_end);581int btrfs_split_item(struct btrfs_trans_handle *trans,582struct btrfs_root *root,583struct btrfs_path *path,584const struct btrfs_key *new_key,585unsigned long split_offset);586int btrfs_duplicate_item(struct btrfs_trans_handle *trans,587struct btrfs_root *root,588struct btrfs_path *path,589const struct btrfs_key *new_key);590int btrfs_find_item(struct btrfs_root *fs_root, struct btrfs_path *path,591u64 inum, u64 ioff, u8 key_type, struct btrfs_key *found_key);592int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,593const struct btrfs_key *key, struct btrfs_path *p,594int ins_len, int cow);595int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,596struct btrfs_path *p, u64 time_seq);597int btrfs_search_slot_for_read(struct btrfs_root *root,598const struct btrfs_key *key,599struct btrfs_path *p, int find_higher,600int return_any);601void btrfs_release_path(struct btrfs_path *p);602struct btrfs_path *btrfs_alloc_path(void);603void btrfs_free_path(struct btrfs_path *p);604DEFINE_FREE(btrfs_free_path, struct btrfs_path *, btrfs_free_path(_T))605606int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,607struct btrfs_path *path, int slot, int nr);608static inline int btrfs_del_item(struct btrfs_trans_handle *trans,609struct btrfs_root *root,610struct btrfs_path *path)611{612return btrfs_del_items(trans, root, path, path->slots[0], 1);613}614615/*616* Describes a batch of items to insert in a btree. This is used by617* btrfs_insert_empty_items().618*/619struct btrfs_item_batch {620/*621* Pointer to an array containing the keys of the items to insert (in622* sorted order).623*/624const struct btrfs_key *keys;625/* Pointer to an array containing the data size for each item to insert. */626const u32 *data_sizes;627/*628* The sum of data sizes for all items. The caller can compute this while629* setting up the data_sizes array, so it ends up being more efficient630* than having btrfs_insert_empty_items() or setup_item_for_insert()631* doing it, as it would avoid an extra loop over a potentially large632* array, and in the case of setup_item_for_insert(), we would be doing633* it while holding a write lock on a leaf and often on upper level nodes634* too, unnecessarily increasing the size of a critical section.635*/636u32 total_data_size;637/* Size of the keys and data_sizes arrays (number of items in the batch). */638int nr;639};640641void btrfs_setup_item_for_insert(struct btrfs_trans_handle *trans,642struct btrfs_root *root,643struct btrfs_path *path,644const struct btrfs_key *key,645u32 data_size);646int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root,647const struct btrfs_key *key, void *data, u32 data_size);648int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,649struct btrfs_root *root,650struct btrfs_path *path,651const struct btrfs_item_batch *batch);652653static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans,654struct btrfs_root *root,655struct btrfs_path *path,656const struct btrfs_key *key,657u32 data_size)658{659struct btrfs_item_batch batch;660661batch.keys = key;662batch.data_sizes = &data_size;663batch.total_data_size = data_size;664batch.nr = 1;665666return btrfs_insert_empty_items(trans, root, path, &batch);667}668669int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,670u64 time_seq);671672int btrfs_search_backwards(struct btrfs_root *root, struct btrfs_key *key,673struct btrfs_path *path);674675int btrfs_get_next_valid_item(struct btrfs_root *root, struct btrfs_key *key,676struct btrfs_path *path);677678/*679* Search in @root for a given @key, and store the slot found in @found_key.680*681* @root: The root node of the tree.682* @key: The key we are looking for.683* @found_key: Will hold the found item.684* @path: Holds the current slot/leaf.685* @iter_ret: Contains the value returned from btrfs_search_slot or686* btrfs_get_next_valid_item, whichever was executed last.687*688* The @iter_ret is an output variable that will contain the return value of689* btrfs_search_slot, if it encountered an error, or the value returned from690* btrfs_get_next_valid_item otherwise. That return value can be 0, if a valid691* slot was found, 1 if there were no more leaves, and <0 if there was an error.692*693* It's recommended to use a separate variable for iter_ret and then use it to694* set the function return value so there's no confusion of the 0/1/errno695* values stemming from btrfs_search_slot.696*/697#define btrfs_for_each_slot(root, key, found_key, path, iter_ret) \698for (iter_ret = btrfs_search_slot(NULL, (root), (key), (path), 0, 0); \699(iter_ret) >= 0 && \700(iter_ret = btrfs_get_next_valid_item((root), (found_key), (path))) == 0; \701(path)->slots[0]++ \702)703704int btrfs_next_old_item(struct btrfs_root *root, struct btrfs_path *path, u64 time_seq);705706/*707* Search the tree again to find a leaf with greater keys.708*709* Returns 0 if it found something or 1 if there are no greater leaves.710* Returns < 0 on error.711*/712static inline int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)713{714return btrfs_next_old_leaf(root, path, 0);715}716717static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p)718{719return btrfs_next_old_item(root, p, 0);720}721int btrfs_leaf_free_space(const struct extent_buffer *leaf);722723static inline bool btrfs_is_fstree(u64 rootid)724{725if (rootid == BTRFS_FS_TREE_OBJECTID)726return true;727728if ((s64)rootid < (s64)BTRFS_FIRST_FREE_OBJECTID)729return false;730731if (btrfs_qgroup_level(rootid) != 0)732return false;733734return true;735}736737static inline bool btrfs_is_data_reloc_root(const struct btrfs_root *root)738{739return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID;740}741742#endif743744745