Lines Matching full:refs
94 * the delayed refs are not processed.
98 u64 offset, int metadata, u64 *refs, u64 *flags,
186 refcount_inc(&head->refs);
211 if (refs)
212 *refs = num_refs;
222 * Back reference rules. Back refs have three main goals:
235 * There are two kinds of back refs. The implicit back refs is optimized
237 * back refs of this kind provide information about the block's owner tree
239 * b-tree searching. The full back refs is for pointers in tree blocks not
241 * in the back refs. Actually the full back refs is generic, and can be
242 * used in all cases the implicit back refs is used. The major shortcoming
243 * of the full back refs is its overhead. Every time a tree block gets
244 * COWed, we have to update back refs entry for all pointers in it.
246 * For a newly allocated tree block, we use implicit back refs for
248 * implicit back refs. For a tree block created in old transaction, the
251 * back refs conversion.
259 * block's owner tree. In this case, full back refs is used for pointers
260 * in the block. Remove these full back refs, add implicit back refs for
264 * the block's owner tree. In this case, implicit back refs is used for
265 * pointers in the block. Add full back refs for every pointers in the
267 * implicit back refs are entailed to the new block.
270 * not the block's owner tree. Add implicit back refs for every pointer in
276 * The key type is used to differentiate between types of back refs.
278 * of back refs.
286 * The extent ref structure for the implicit back refs has fields for:
293 * The key offset for the implicit back refs is hash of the first
296 * The extent ref structure for the full back refs has field for:
300 * The key offset for the implicit back refs is the first byte of
303 * When a file extent is allocated, The implicit back refs is used.
309 * corresponding implicit back refs and check the following fields:
317 * Both the implicit back refs and the full back refs for tree blocks
318 * only consist of key. The key offset for the implicit back refs is
319 * objectid of block's owner tree. The key offset for the full back refs
322 * When implicit back refs is used, information about the lowest key and
754 * if insert is true and there are too many inline back refs, the path
757 * NOTE: inline back refs are ordered in the same way that back ref
1003 u64 refs;
1017 refs = btrfs_extent_refs(leaf, ei);
1018 refs += refs_to_add;
1019 btrfs_set_extent_refs(leaf, ei, refs);
1097 u64 refs;
1100 refs = btrfs_extent_refs(leaf, ei);
1101 if (unlikely(refs_to_mod < 0 && refs + refs_to_mod <= 0)) {
1113 key.objectid, extent_size, refs_to_mod, refs);
1116 refs += refs_to_mod;
1117 btrfs_set_extent_refs(leaf, ei, refs);
1131 refs = btrfs_extent_data_ref_count(leaf, dref);
1134 refs = btrfs_shared_data_ref_count(leaf, sref);
1136 refs = 1;
1139 * blocks should not have refs > 1.
1158 if (unlikely(refs_to_mod < 0 && refs < -refs_to_mod)) {
1171 refs_to_mod, refs);
1174 refs += refs_to_mod;
1176 if (refs > 0) {
1178 btrfs_set_extent_data_ref_count(leaf, dref, refs);
1180 btrfs_set_shared_data_ref_count(leaf, sref, refs);
1211 * We're adding refs to a tree block we already own, this
1217 "adding refs to an existing tree ref, bytenr %llu num_bytes %llu root_objectid %llu slot %u",
1495 u64 refs;
1518 refs = btrfs_extent_refs(leaf, item);
1519 btrfs_set_extent_refs(leaf, item, refs + refs_to_add);
1835 * We had csum deletions accounted for in our delayed refs rsv, we need
2086 * Normally delayed refs get processed in ascending bytenr order. This
2240 refcount_inc(&head->refs);
2320 * locking to avoid races between the checks and flushing delayed refs,
2381 /* No inline refs; we need to bail before checking for owner ref. */
2385 /* Check for an owner ref; skip over it to the real inline refs. */
2969 /* We have inline refs, but not an owner ref. */
3023 * Drop one or more refs of @node.
3025 * 1. Locate the extent refs.
3027 * Locate it, then reduce the refs number or remove the ref line completely.
3029 * 2. Update the refs count in EXTENT/METADATA_ITEM
3036 * refs 2 gen 6 flags DATA
3052 * refs 1 gen 6 flags DATA
3060 * refs 754 gen 6 flags DATA
3077 * refs 753 gen 6 flags DATA
3100 u64 refs;
3119 "invalid refs_to_drop, dropping more than 1 refs for tree block %llu refs_to_drop %u",
3267 refs = btrfs_extent_refs(leaf, ei);
3268 if (unlikely(refs < refs_to_drop)) {
3270 "trying to drop %d refs but we only have %llu for bytenr %llu slot %u",
3271 refs_to_drop, refs, bytenr, path->slots[0]);
3274 refs -= refs_to_drop;
3276 if (refs > 0) {
3291 btrfs_set_extent_refs(leaf, ei, refs);
3310 /* In this branch refs == 1 */
3315 "invalid refs_to_drop, current refs %u refs_to_drop %u slot %u",
3374 * a given extent, and if there are no other delayed refs to be processed, it
5227 u64 refs[BTRFS_MAX_LEVEL];
5266 * @refs: the number of refs for wc->level - 1
5287 ASSERT(wc->refs[level - 1] > 0);
5301 * any refs it's pointing at.
5303 if (wc->refs[level - 1] == 1)
5341 u64 refs;
5378 wc->level - 1, 1, &refs,
5386 * up with a bogus refs count, if that's the case just skip, if
5390 if (refs == 0)
5407 * back refs for pointers in the block.
5430 ((wc->stage == DROP_REFERENCE && wc->refs[level] != 1) ||
5435 &wc->refs[level],
5440 if (unlikely(wc->refs[level] == 0)) {
5448 if (wc->refs[level] > 1)
5536 refcount_inc(&head->refs);
5635 * If we had a drop_progress we need to verify the refs are set as
5655 wc->refs[level - 1] > 1) {
5685 * is shared and we need update back refs for the subtree
5710 * was created, we know there is no need to update back refs
5729 &wc->refs[level - 1],
5735 if (unlikely(wc->refs[level - 1] == 0)) {
5753 if (wc->stage == DROP_REFERENCE && wc->refs[level - 1] > 1) {
5780 wc->refs[level - 1] = 0;
5840 &wc->refs[level],
5848 if (unlikely(wc->refs[level] == 0)) {
5854 if (wc->refs[level] == 1) {
5863 ASSERT(path->locks[level] || wc->refs[level] == 1);
5865 if (wc->refs[level] == 1) {
5911 wc->refs[level] == 1);
5915 wc->refs[level] = 0;
5988 * back to DROP_REFERENCE, lookup the current nodes refs and flags, and carry on.
5990 * DROP_REFERENCE. If our refs == 1 then we're going to free this tree block.
6141 level, 1, &wc->refs[level],
6146 BUG_ON(wc->refs[level] == 0);
6153 WARN_ON(wc->refs[level] != 1);
6339 refcount_inc(&parent->refs);
6349 wc->refs[parent_level] = 1;