Lines Matching defs:refs

111  * the delayed refs are not processed.
115 u64 offset, int metadata, u64 *refs, u64 *flags)
204 refcount_inc(&head->refs);
231 if (refs)
232 *refs = num_refs;
241 * Back reference rules. Back refs have three main goals:
254 * There are two kinds of back refs. The implicit back refs is optimized
256 * back refs of this kind provide information about the block's owner tree
258 * b-tree searching. The full back refs is for pointers in tree blocks not
260 * in the back refs. Actually the full back refs is generic, and can be
261 * used in all cases the implicit back refs is used. The major shortcoming
262 * of the full back refs is its overhead. Every time a tree block gets
263 * COWed, we have to update back refs entry for all pointers in it.
265 * For a newly allocated tree block, we use implicit back refs for
267 * implicit back refs. For a tree block created in old transaction, the
270 * back refs conversion.
278 * block's owner tree. In this case, full back refs is used for pointers
279 * in the block. Remove these full back refs, add implicit back refs for
283 * the block's owner tree. In this case, implicit back refs is used for
284 * pointers in the block. Add full back refs for every pointers in the
286 * implicit back refs are entailed to the new block.
289 * not the block's owner tree. Add implicit back refs for every pointer in
295 * The key type is used to differentiate between types of back refs.
297 * of back refs.
305 * The extent ref structure for the implicit back refs has fields for:
312 * The key offset for the implicit back refs is hash of the first
315 * The extent ref structure for the full back refs has field for:
319 * The key offset for the implicit back refs is the first byte of
322 * When a file extent is allocated, The implicit back refs is used.
328 * corresponding implicit back refs and check the following fields:
336 * Both the implicit back refs and the full back refs for tree blocks
337 * only consist of key. The key offset for the implicit back refs is
338 * objectid of block's owner tree. The key offset for the full back refs
341 * When implicit back refs is used, information about the lowest key and
773 * if insert is true and there are too many inline back refs, the path
776 * NOTE: inline back refs are ordered in the same way that back ref
990 u64 refs;
1004 refs = btrfs_extent_refs(leaf, ei);
1005 refs += refs_to_add;
1006 btrfs_set_extent_refs(leaf, ei, refs);
1084 u64 refs;
1087 refs = btrfs_extent_refs(leaf, ei);
1088 WARN_ON(refs_to_mod < 0 && refs + refs_to_mod <= 0);
1089 refs += refs_to_mod;
1090 btrfs_set_extent_refs(leaf, ei, refs);
1103 refs = btrfs_extent_data_ref_count(leaf, dref);
1106 refs = btrfs_shared_data_ref_count(leaf, sref);
1108 refs = 1;
1112 BUG_ON(refs_to_mod < 0 && refs < -refs_to_mod);
1113 refs += refs_to_mod;
1115 if (refs > 0) {
1117 btrfs_set_extent_data_ref_count(leaf, dref, refs);
1119 btrfs_set_shared_data_ref_count(leaf, sref, refs);
1151 * We're adding refs to a tree block we already own, this
1156 "adding refs to an existing tree ref, bytenr %llu num_bytes %llu root_objectid %llu",
1430 u64 refs;
1453 refs = btrfs_extent_refs(leaf, item);
1454 btrfs_set_extent_refs(leaf, item, refs + refs_to_add);
1774 * We had csum deletions accounted for in our delayed refs rsv, we need
1785 * We were dropping refs, or had a new ref and dropped it, and thus must
1867 * Grab the lock that says we are going to process all the refs for
2060 * Normally delayed refs get processed in ascending bytenr order. This
2172 refcount_inc(&head->refs);
2240 refcount_inc(&head->refs);
2895 * Drop one or more refs of @node.
2897 * 1. Locate the extent refs.
2899 * Locate it, then reduce the refs number or remove the ref line completely.
2901 * 2. Update the refs count in EXTENT/METADATA_ITEM
2908 * refs 2 gen 6 flags DATA
2924 * refs 1 gen 6 flags DATA
2932 * refs 754 gen 6 flags DATA
2949 * refs 753 gen 6 flags DATA
2972 u64 refs;
2988 "invalid refs_to_drop, dropping more than 1 refs for tree block %llu refs_to_drop %u",
3138 refs = btrfs_extent_refs(leaf, ei);
3139 if (refs < refs_to_drop) {
3141 "trying to drop %d refs but we only have %llu for bytenr %llu",
3142 refs_to_drop, refs, bytenr);
3146 refs -= refs_to_drop;
3148 if (refs > 0) {
3163 btrfs_set_extent_refs(leaf, ei, refs);
3176 /* In this branch refs == 1 */
3181 "invalid refs_to_drop, current refs %u refs_to_drop %u",
3267 * a given extent, and if there are no other delayed refs to be processed, it
4740 u64 refs[BTRFS_MAX_LEVEL];
4766 u64 refs;
4804 wc->level - 1, 1, &refs,
4809 BUG_ON(refs == 0);
4812 if (refs == 1)
4842 * back refs for pointers in the block.
4866 ((wc->stage == DROP_REFERENCE && wc->refs[level] != 1) ||
4871 &wc->refs[level],
4876 BUG_ON(wc->refs[level] == 0);
4880 if (wc->refs[level] > 1)
4946 * is shared and we need update back refs for the subtree
4976 * was created, we know there is no need to update back refs
5003 &wc->refs[level - 1],
5008 if (unlikely(wc->refs[level - 1] == 0)) {
5016 if (wc->refs[level - 1] > 1) {
5078 wc->refs[level - 1] = 0;
5097 * If we had a drop_progress we need to verify the refs are set
5205 &wc->refs[level],
5212 BUG_ON(wc->refs[level] == 0);
5213 if (wc->refs[level] == 1) {
5222 BUG_ON(wc->refs[level] > 1 && !path->locks[level]);
5224 if (wc->refs[level] == 1) {
5263 btrfs_free_tree_block(trans, root, eb, parent, wc->refs[level] == 1);
5265 wc->refs[level] = 0;
5448 level, 1, &wc->refs[level],
5454 BUG_ON(wc->refs[level] == 0);
5461 WARN_ON(wc->refs[level] != 1);
5631 atomic_inc(&parent->refs);
5641 wc->refs[parent_level] = 1;