Lines Matching +full:compare +full:- +full:and +full:- +full:swap

1 /* SPDX-License-Identifier: GPL-2.0 */
22 #include "extent-io-tree.h"
41 * will still trigger readahead for other nodes and leaves that follow
52 * level 0 is always the leaf, and nodes[1...BTRFS_MAX_LEVEL] will point
68 * and to force calls to keep space in the nodes
79 * existing item and ins_len contains only the data size and not item
95 * btrfs_record_root_in_trans is a multi-step process, and it can race
96 * with the balancing code. But the race is very small, and only the
104 * Only subvolume trees and their reloc trees have this bit set.
109 * - How balance works
110 * For shareable roots, we need to use reloc tree and do path
111 * replacement for balance, and need various pre/post hooks for
114 * While for non-shareable trees, we just simply do a tree search
117 * - How dirty roots are tracked
119 * track them, while non-subvolume roots have TRACK_DIRTY bit, they
140 /* The root has a log tree. Used for subvolume roots and the tree root. */
165 * and for the extent tree extent_root root.
209 * btrfs_get_root_last_log_commit() and btrfs_set_root_last_log_commit()
222 /* The dirty list is only used by non-shareable roots */
227 /* Xarray that keeps track of in-memory inodes. */
261 * these can span multiple transactions and basically include
269 * Not empty if this subvolume root has gone through tree block swap
278 * manipulation with the read-only status via SUBVOL_SETFLAGS
287 /* For exclusion of snapshot creation and nocow writes */
321 /* Byte-swap the constant at compile time, root_item::flags is LE */ in btrfs_root_readonly()
322 return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0; in btrfs_root_readonly()
327 /* Byte-swap the constant at compile time, root_item::flags is LE */ in btrfs_root_dead()
328 return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_DEAD)) != 0; in btrfs_root_dead()
333 return root->root_key.objectid; in btrfs_root_id()
338 return READ_ONCE(root->log_transid); in btrfs_get_root_log_transid()
343 WRITE_ONCE(root->log_transid, log_transid); in btrfs_set_root_log_transid()
348 return READ_ONCE(root->last_log_commit); in btrfs_get_root_last_log_commit()
353 WRITE_ONCE(root->last_log_commit, commit_id); in btrfs_set_root_last_log_commit()
358 return READ_ONCE(root->last_trans); in btrfs_get_root_last_trans()
363 WRITE_ONCE(root->last_trans, transid); in btrfs_set_root_last_trans()
369 * Every normal root that is created with root->root_key.offset set to it's
381 return btrfs_root_last_snapshot(&root->root_item); in btrfs_root_origin_generation()
382 return root->root_key.offset; in btrfs_root_origin_generation()
403 /* Indicate if we should update the inode's mtime and ctime. */
422 * If NULL, btrfs_drop_extents() will allocate and free its own path.
424 * is always released except if 'replace_extent' is true and
438 * parameter must be set as well and the 'extent_inserted' field will
453 * Set to the minimum between the input parameter 'end' and the end
484 return info->nodesize - sizeof(struct btrfs_header); in BTRFS_LEAF_DATA_SIZE()
489 return BTRFS_LEAF_DATA_SIZE(info) - sizeof(struct btrfs_item); in BTRFS_MAX_ITEM_SIZE()
499 return BTRFS_MAX_ITEM_SIZE(info) - sizeof(struct btrfs_dir_item); in BTRFS_MAX_XATTR_SIZE()
513 * Compare two keys, on little-endian the disk order is same as CPU order and
526 /* Compare two keys in a memcmp fashion. */
613 return btrfs_del_items(trans, root, path, path->slots[0], 1); in btrfs_del_item()
633 * array, and in the case of setup_item_for_insert(), we would be doing
634 * it while holding a write lock on a leaf and often on upper level nodes
638 /* Size of the keys and data_sizes arrays (number of items in the batch). */
680 * Search in @root for a given @key, and store the slot found in @found_key.
692 * slot was found, 1 if there were no more leaves, and <0 if there was an error.
694 * It's recommended to use a separate variable for iter_ret and then use it to
702 (path)->slots[0]++ \
740 return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID; in btrfs_is_data_reloc_root()