Lines Matching defs:refs

99  * the delayed refs are not processed.
103 u64 offset, int metadata, u64 *refs, u64 *flags)
196 refcount_inc(&head->refs);
223 if (refs)
224 *refs = num_refs;
233 * Back reference rules. Back refs have three main goals:
246 * There are two kinds of back refs. The implicit back refs is optimized
248 * back refs of this kind provide information about the block's owner tree
250 * b-tree searching. The full back refs is for pointers in tree blocks not
252 * in the back refs. Actually the full back refs is generic, and can be
253 * used in all cases the implicit back refs is used. The major shortcoming
254 * of the full back refs is its overhead. Every time a tree block gets
255 * COWed, we have to update back refs entry for all pointers in it.
257 * For a newly allocated tree block, we use implicit back refs for
259 * implicit back refs. For a tree block created in old transaction, the
262 * back refs conversion.
270 * block's owner tree. In this case, full back refs is used for pointers
271 * in the block. Remove these full back refs, add implicit back refs for
275 * the block's owner tree. In this case, implicit back refs is used for
276 * pointers in the block. Add full back refs for every pointers in the
278 * implicit back refs are entailed to the new block.
281 * not the block's owner tree. Add implicit back refs for every pointer in
287 * The key type is used to differentiate between types of back refs.
289 * of back refs.
297 * The extent ref structure for the implicit back refs has fields for:
304 * The key offset for the implicit back refs is hash of the first
307 * The extent ref structure for the full back refs has field for:
311 * The key offset for the implicit back refs is the first byte of
314 * When a file extent is allocated, The implicit back refs is used.
320 * corresponding implicit back refs and check the following fields:
328 * Both the implicit back refs and the full back refs for tree blocks
329 * only consist of key. The key offset for the implicit back refs is
330 * objectid of block's owner tree. The key offset for the full back refs
333 * When implicit back refs is used, information about the lowest key and
764 * if insert is true and there are too many inline back refs, the path
767 * NOTE: inline back refs are ordered in the same way that back ref
991 u64 refs;
1005 refs = btrfs_extent_refs(leaf, ei);
1006 refs += refs_to_add;
1007 btrfs_set_extent_refs(leaf, ei, refs);
1086 u64 refs;
1089 refs = btrfs_extent_refs(leaf, ei);
1090 if (unlikely(refs_to_mod < 0 && refs + refs_to_mod <= 0)) {
1102 key.objectid, extent_size, refs_to_mod, refs);
1105 refs += refs_to_mod;
1106 btrfs_set_extent_refs(leaf, ei, refs);
1120 refs = btrfs_extent_data_ref_count(leaf, dref);
1123 refs = btrfs_shared_data_ref_count(leaf, sref);
1125 refs = 1;
1128 * blocks should not have refs > 1.
1147 if (unlikely(refs_to_mod < 0 && refs < -refs_to_mod)) {
1160 refs_to_mod, refs);
1163 refs += refs_to_mod;
1165 if (refs > 0) {
1167 btrfs_set_extent_data_ref_count(leaf, dref, refs);
1169 btrfs_set_shared_data_ref_count(leaf, sref, refs);
1201 * We're adding refs to a tree block we already own, this
1207 "adding refs to an existing tree ref, bytenr %llu num_bytes %llu root_objectid %llu slot %u",
1491 u64 refs;
1513 refs = btrfs_extent_refs(leaf, item);
1514 btrfs_set_extent_refs(leaf, item, refs + refs_to_add);
1838 * We had csum deletions accounted for in our delayed refs rsv, we need
1921 * Grab the lock that says we are going to process all the refs for
2090 * Normally delayed refs get processed in ascending bytenr order. This
2183 refcount_inc(&head->refs);
2256 refcount_inc(&head->refs);
2889 * Drop one or more refs of @node.
2891 * 1. Locate the extent refs.
2893 * Locate it, then reduce the refs number or remove the ref line completely.
2895 * 2. Update the refs count in EXTENT/METADATA_ITEM
2902 * refs 2 gen 6 flags DATA
2918 * refs 1 gen 6 flags DATA
2926 * refs 754 gen 6 flags DATA
2943 * refs 753 gen 6 flags DATA
2966 u64 refs;
2982 "invalid refs_to_drop, dropping more than 1 refs for tree block %llu refs_to_drop %u",
3132 refs = btrfs_extent_refs(leaf, ei);
3133 if (refs < refs_to_drop) {
3135 "trying to drop %d refs but we only have %llu for bytenr %llu slot %u",
3136 refs_to_drop, refs, bytenr, path->slots[0]);
3140 refs -= refs_to_drop;
3142 if (refs > 0) {
3158 btrfs_set_extent_refs(leaf, ei, refs);
3170 /* In this branch refs == 1 */
3175 "invalid refs_to_drop, current refs %u refs_to_drop %u slot %u",
3229 * a given extent, and if there are no other delayed refs to be processed, it
5018 u64 refs[BTRFS_MAX_LEVEL];
5044 u64 refs;
5082 wc->level - 1, 1, &refs,
5087 BUG_ON(refs == 0);
5090 if (refs == 1)
5120 * back refs for pointers in the block.
5144 ((wc->stage == DROP_REFERENCE && wc->refs[level] != 1) ||
5149 &wc->refs[level],
5154 BUG_ON(wc->refs[level] == 0);
5158 if (wc->refs[level] > 1)
5223 * is shared and we need update back refs for the subtree
5253 * was created, we know there is no need to update back refs
5282 &wc->refs[level - 1],
5287 if (unlikely(wc->refs[level - 1] == 0)) {
5295 if (wc->refs[level - 1] > 1) {
5355 wc->refs[level - 1] = 0;
5374 * If we had a drop_progress we need to verify the refs are set
5482 &wc->refs[level],
5489 BUG_ON(wc->refs[level] == 0);
5490 if (wc->refs[level] == 1) {
5499 BUG_ON(wc->refs[level] > 1 && !path->locks[level]);
5501 if (wc->refs[level] == 1) {
5539 wc->refs[level] == 1);
5541 wc->refs[level] = 0;
5727 level, 1, &wc->refs[level],
5733 BUG_ON(wc->refs[level] == 0);
5740 WARN_ON(wc->refs[level] != 1);
5925 atomic_inc(&parent->refs);
5935 wc->refs[parent_level] = 1;