Lines Matching +full:s +full:- +full:merged
1 // SPDX-License-Identifier: GPL-2.0
11 #include "disk-io.h"
21 return -ENOMEM; in extent_map_init()
36 tree->root = RB_ROOT; in extent_map_tree_init()
37 INIT_LIST_HEAD(&tree->modified_extents); in extent_map_tree_init()
38 rwlock_init(&tree->lock); in extent_map_tree_init()
51 RB_CLEAR_NODE(&em->rb_node); in alloc_extent_map()
52 refcount_set(&em->refs, 1); in alloc_extent_map()
53 INIT_LIST_HEAD(&em->list); in alloc_extent_map()
65 if (refcount_dec_and_test(&em->refs)) { in free_extent_map()
67 WARN_ON(!list_empty(&em->list)); in free_extent_map()
76 return (u64)-1; in range_end()
82 struct btrfs_fs_info *fs_info = inode->root->fs_info; in remove_em()
84 rb_erase(&em->rb_node, &inode->extent_tree.root); in remove_em()
85 RB_CLEAR_NODE(&em->rb_node); in remove_em()
87 if (!btrfs_is_testing(fs_info) && is_fstree(btrfs_root_id(inode->root))) in remove_em()
88 percpu_counter_dec(&fs_info->evictable_extent_maps); in remove_em()
93 struct rb_node **p = &root->rb_node; in tree_insert()
97 u64 end = range_end(em->start, em->len); in tree_insert()
103 if (em->start < entry->start) in tree_insert()
104 p = &(*p)->rb_left; in tree_insert()
105 else if (em->start >= extent_map_end(entry)) in tree_insert()
106 p = &(*p)->rb_right; in tree_insert()
108 return -EEXIST; in tree_insert()
112 while (parent && em->start >= extent_map_end(entry)) { in tree_insert()
117 if (end > entry->start && em->start < extent_map_end(entry)) in tree_insert()
118 return -EEXIST; in tree_insert()
122 while (parent && em->start < entry->start) { in tree_insert()
127 if (end > entry->start && em->start < extent_map_end(entry)) in tree_insert()
128 return -EEXIST; in tree_insert()
130 rb_link_node(&em->rb_node, orig_parent, p); in tree_insert()
131 rb_insert_color(&em->rb_node, root); in tree_insert()
142 struct rb_node *n = root->rb_node; in __tree_search()
155 if (offset < entry->start) in __tree_search()
156 n = n->rb_left; in __tree_search()
158 n = n->rb_right; in __tree_search()
180 while (prev && offset < prev_entry->start) { in __tree_search()
192 return em->disk_num_bytes; in extent_map_block_len()
193 return em->len; in extent_map_block_len()
202 return (u64)-1; in extent_map_block_end()
209 if (em->flags & EXTENT_FLAG_PINNED) in can_merge_extent_map()
216 if (em->flags & EXTENT_FLAG_LOGGING) in can_merge_extent_map()
224 if (!list_empty(&em->list)) in can_merge_extent_map()
233 if (extent_map_end(prev) != next->start) in mergeable_maps()
237 * The merged flag is not an on-disk flag, it just indicates we had the in mergeable_maps()
238 * extent maps of 2 (or more) adjacent extents merged, so factor it out. in mergeable_maps()
240 if ((prev->flags & ~EXTENT_FLAG_MERGED) != in mergeable_maps()
241 (next->flags & ~EXTENT_FLAG_MERGED)) in mergeable_maps()
244 if (next->disk_bytenr < EXTENT_MAP_LAST_BYTE - 1) in mergeable_maps()
248 return next->disk_bytenr == prev->disk_bytenr; in mergeable_maps()
252 * Handle the on-disk data extents merge for @prev and @next.
256 * @merged: the extent we will not discard after the merge; updated with new values
258 * After this, one of the two extents is the new merged extent and the other is
259 * removed from the tree and likely freed. Note that @merged is one of @prev/@next
260 * so there is const/non-const aliasing occurring here.
263 * For now only uncompressed regular extent can be merged.
266 struct extent_map *merged) in merge_ondisk_extents() argument
277 * There are two different cases where @prev and @next can be merged. in merge_ondisk_extents()
281 * |<----- data extent A ----->| in merge_ondisk_extents()
282 * |<- prev ->|<- next ->| in merge_ondisk_extents()
286 * |<-- data extent A -->|<-- data extent B -->| in merge_ondisk_extents()
287 * |<- prev ->|<- next ->| in merge_ondisk_extents()
292 * For case 1), the merged data extent would be the same. in merge_ondisk_extents()
295 new_disk_bytenr = min(prev->disk_bytenr, next->disk_bytenr); in merge_ondisk_extents()
296 new_disk_num_bytes = max(prev->disk_bytenr + prev->disk_num_bytes, in merge_ondisk_extents()
297 next->disk_bytenr + next->disk_num_bytes) - in merge_ondisk_extents()
299 new_offset = prev->disk_bytenr + prev->offset - new_disk_bytenr; in merge_ondisk_extents()
301 merged->disk_bytenr = new_disk_bytenr; in merge_ondisk_extents()
302 merged->disk_num_bytes = new_disk_num_bytes; in merge_ondisk_extents()
303 merged->ram_bytes = new_disk_num_bytes; in merge_ondisk_extents()
304 merged->offset = new_offset; in merge_ondisk_extents()
313 "%s, start=%llu len=%llu disk_bytenr=%llu disk_num_bytes=%llu ram_bytes=%llu offset=%llu flags=0x%x… in dump_extent_map()
314 prefix, em->start, em->len, em->disk_bytenr, em->disk_num_bytes, in dump_extent_map()
315 em->ram_bytes, em->offset, em->flags); in dump_extent_map()
324 if (em->disk_bytenr < EXTENT_MAP_LAST_BYTE) { in validate_extent_map()
325 if (em->disk_num_bytes == 0) in validate_extent_map()
327 if (em->offset + em->len > em->ram_bytes) in validate_extent_map()
329 if (em->offset + em->len > em->disk_num_bytes && in validate_extent_map()
333 em->ram_bytes != em->disk_num_bytes) in validate_extent_map()
335 "ram_bytes mismatch with disk_num_bytes for non-compressed em", in validate_extent_map()
337 } else if (em->offset) { in validate_extent_map()
338 dump_extent_map(fs_info, "non-zero offset for hole/inline", em); in validate_extent_map()
344 struct btrfs_fs_info *fs_info = inode->root->fs_info; in try_merge_map()
353 * clearing the logging flag), so anything > 2 means it's being used by in try_merge_map()
356 if (refcount_read(&em->refs) > 2) in try_merge_map()
362 if (em->start != 0) { in try_merge_map()
363 rb = rb_prev(&em->rb_node); in try_merge_map()
367 em->start = merge->start; in try_merge_map()
368 em->len += merge->len; in try_merge_map()
369 em->generation = max(em->generation, merge->generation); in try_merge_map()
371 if (em->disk_bytenr < EXTENT_MAP_LAST_BYTE) in try_merge_map()
373 em->flags |= EXTENT_FLAG_MERGED; in try_merge_map()
381 rb = rb_next(&em->rb_node); in try_merge_map()
385 em->len += merge->len; in try_merge_map()
386 if (em->disk_bytenr < EXTENT_MAP_LAST_BYTE) in try_merge_map()
389 em->generation = max(em->generation, merge->generation); in try_merge_map()
390 em->flags |= EXTENT_FLAG_MERGED; in try_merge_map()
409 * -ENOENT when the extent is not found in the tree
410 * -EUCLEAN if the found extent does not match the expected start
414 struct btrfs_fs_info *fs_info = inode->root->fs_info; in unpin_extent_cache()
415 struct extent_map_tree *tree = &inode->extent_tree; in unpin_extent_cache()
419 write_lock(&tree->lock); in unpin_extent_cache()
425 btrfs_ino(inode), btrfs_root_id(inode->root), in unpin_extent_cache()
427 ret = -ENOENT; in unpin_extent_cache()
431 if (WARN_ON(em->start != start)) { in unpin_extent_cache()
434 btrfs_ino(inode), btrfs_root_id(inode->root), in unpin_extent_cache()
435 em->start, start, start + len, gen); in unpin_extent_cache()
436 ret = -EUCLEAN; in unpin_extent_cache()
440 em->generation = gen; in unpin_extent_cache()
441 em->flags &= ~EXTENT_FLAG_PINNED; in unpin_extent_cache()
446 write_unlock(&tree->lock); in unpin_extent_cache()
454 lockdep_assert_held_write(&inode->extent_tree.lock); in clear_em_logging()
456 em->flags &= ~EXTENT_FLAG_LOGGING; in clear_em_logging()
465 refcount_inc(&em->refs); in setup_extent_mapping()
467 ASSERT(list_empty(&em->list)); in setup_extent_mapping()
470 list_add(&em->list, &inode->extent_tree.modified_extents); in setup_extent_mapping()
476 * Add a new extent map to an inode's extent map tree.
483 * Insert @em into the @inode's extent map tree or perform a simple
491 struct extent_map_tree *tree = &inode->extent_tree; in add_extent_mapping()
492 struct btrfs_root *root = inode->root; in add_extent_mapping()
493 struct btrfs_fs_info *fs_info = root->fs_info; in add_extent_mapping()
496 lockdep_assert_held_write(&tree->lock); in add_extent_mapping()
499 ret = tree_insert(&tree->root, em); in add_extent_mapping()
506 percpu_counter_inc(&fs_info->evictable_extent_maps); in add_extent_mapping()
520 rb_node = __tree_search(&tree->root, start, &prev_or_next); in __lookup_extent_mapping()
530 if (strict && !(end > em->start && start < extent_map_end(em))) in __lookup_extent_mapping()
533 refcount_inc(&em->refs); in __lookup_extent_mapping()
574 * Remove an extent_map from its inode's extent tree.
584 struct extent_map_tree *tree = &inode->extent_tree; in remove_extent_mapping()
586 lockdep_assert_held_write(&tree->lock); in remove_extent_mapping()
588 WARN_ON(em->flags & EXTENT_FLAG_PINNED); in remove_extent_mapping()
589 if (!(em->flags & EXTENT_FLAG_LOGGING)) in remove_extent_mapping()
590 list_del_init(&em->list); in remove_extent_mapping()
600 struct btrfs_fs_info *fs_info = inode->root->fs_info; in replace_extent_mapping()
601 struct extent_map_tree *tree = &inode->extent_tree; in replace_extent_mapping()
603 lockdep_assert_held_write(&tree->lock); in replace_extent_mapping()
607 WARN_ON(cur->flags & EXTENT_FLAG_PINNED); in replace_extent_mapping()
609 if (!(cur->flags & EXTENT_FLAG_LOGGING)) in replace_extent_mapping()
610 list_del_init(&cur->list); in replace_extent_mapping()
611 rb_replace_node(&cur->rb_node, &new->rb_node, &tree->root); in replace_extent_mapping()
612 RB_CLEAR_NODE(&cur->rb_node); in replace_extent_mapping()
621 next = rb_next(&em->rb_node); in next_extent_map()
631 prev = rb_prev(&em->rb_node); in prev_extent_map()
654 if (map_start < em->start || map_start >= extent_map_end(em)) in merge_extent_mapping()
655 return -EINVAL; in merge_extent_mapping()
657 if (existing->start > map_start) { in merge_extent_mapping()
665 start = prev ? extent_map_end(prev) : em->start; in merge_extent_mapping()
666 start = max_t(u64, start, em->start); in merge_extent_mapping()
667 end = next ? next->start : extent_map_end(em); in merge_extent_mapping()
669 start_diff = start - em->start; in merge_extent_mapping()
670 em->start = start; in merge_extent_mapping()
671 em->len = end - start; in merge_extent_mapping()
672 if (em->disk_bytenr < EXTENT_MAP_LAST_BYTE) in merge_extent_mapping()
673 em->offset += start_diff; in merge_extent_mapping()
678 * Add extent mapping into an inode's extent map tree.
685 * Note that @em_in's range may be different from [start, start+len),
688 * Insert @em_in into the inode's extent map tree. In case there is an
689 * overlapping range, handle the -EEXIST by either:
694 * Return 0 on success, otherwise -EEXIST.
702 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_add_extent_mapping()
705 * Tree-checker should have rejected any inline extent with non-zero in btrfs_add_extent_mapping()
708 if (em->disk_bytenr == EXTENT_MAP_INLINE) in btrfs_add_extent_mapping()
709 ASSERT(em->start == 0); in btrfs_add_extent_mapping()
716 if (ret == -EEXIST) { in btrfs_add_extent_mapping()
719 existing = search_extent_mapping(&inode->extent_tree, start, len); in btrfs_add_extent_mapping()
724 * existing will always be non-NULL, since there must be in btrfs_add_extent_mapping()
725 * extent causing the -EEXIST. in btrfs_add_extent_mapping()
727 if (start >= existing->start && in btrfs_add_extent_mapping()
733 u64 orig_start = em->start; in btrfs_add_extent_mapping()
734 u64 orig_len = em->len; in btrfs_add_extent_mapping()
746 existing->start, extent_map_end(existing), in btrfs_add_extent_mapping()
753 ASSERT(ret == 0 || ret == -EEXIST); in btrfs_add_extent_mapping()
764 struct extent_map_tree *tree = &inode->extent_tree; in drop_all_extent_maps_fast()
767 write_lock(&tree->lock); in drop_all_extent_maps_fast()
768 node = rb_first(&tree->root); in drop_all_extent_maps_fast()
774 em->flags &= ~(EXTENT_FLAG_PINNED | EXTENT_FLAG_LOGGING); in drop_all_extent_maps_fast()
778 if (cond_resched_rwlock_write(&tree->lock)) in drop_all_extent_maps_fast()
779 node = rb_first(&tree->root); in drop_all_extent_maps_fast()
783 write_unlock(&tree->lock); in drop_all_extent_maps_fast()
797 * The caller should have locked an appropriate file range in the inode's io
806 struct extent_map_tree *em_tree = &inode->extent_tree; in btrfs_drop_extent_map_range()
807 u64 len = end - start + 1; in btrfs_drop_extent_map_range()
810 if (end == (u64)-1) { in btrfs_drop_extent_map_range()
815 len = (u64)-1; in btrfs_drop_extent_map_range()
822 * It's ok if we fail to allocate the extent maps, see the comment near in btrfs_drop_extent_map_range()
832 write_lock(&em_tree->lock); in btrfs_drop_extent_map_range()
846 if (next_em->start < end) in btrfs_drop_extent_map_range()
847 refcount_inc(&next_em->refs); in btrfs_drop_extent_map_range()
853 if (skip_pinned && (em->flags & EXTENT_FLAG_PINNED)) { in btrfs_drop_extent_map_range()
858 flags = em->flags; in btrfs_drop_extent_map_range()
864 em->flags &= ~(EXTENT_FLAG_PINNED | EXTENT_FLAG_LOGGING); in btrfs_drop_extent_map_range()
865 modified = !list_empty(&em->list); in btrfs_drop_extent_map_range()
871 if (em->start >= start && em_end <= end) in btrfs_drop_extent_map_range()
874 gen = em->generation; in btrfs_drop_extent_map_range()
876 if (em->start < start) { in btrfs_drop_extent_map_range()
883 split->start = em->start; in btrfs_drop_extent_map_range()
884 split->len = start - em->start; in btrfs_drop_extent_map_range()
886 if (em->disk_bytenr < EXTENT_MAP_LAST_BYTE) { in btrfs_drop_extent_map_range()
887 split->disk_bytenr = em->disk_bytenr; in btrfs_drop_extent_map_range()
888 split->disk_num_bytes = em->disk_num_bytes; in btrfs_drop_extent_map_range()
889 split->offset = em->offset; in btrfs_drop_extent_map_range()
890 split->ram_bytes = em->ram_bytes; in btrfs_drop_extent_map_range()
892 split->disk_bytenr = em->disk_bytenr; in btrfs_drop_extent_map_range()
893 split->disk_num_bytes = 0; in btrfs_drop_extent_map_range()
894 split->offset = 0; in btrfs_drop_extent_map_range()
895 split->ram_bytes = split->len; in btrfs_drop_extent_map_range()
898 split->generation = gen; in btrfs_drop_extent_map_range()
899 split->flags = flags; in btrfs_drop_extent_map_range()
912 split->start = end; in btrfs_drop_extent_map_range()
913 split->len = em_end - end; in btrfs_drop_extent_map_range()
914 split->disk_bytenr = em->disk_bytenr; in btrfs_drop_extent_map_range()
915 split->flags = flags; in btrfs_drop_extent_map_range()
916 split->generation = gen; in btrfs_drop_extent_map_range()
918 if (em->disk_bytenr < EXTENT_MAP_LAST_BYTE) { in btrfs_drop_extent_map_range()
919 split->disk_num_bytes = em->disk_num_bytes; in btrfs_drop_extent_map_range()
920 split->offset = em->offset + end - em->start; in btrfs_drop_extent_map_range()
921 split->ram_bytes = em->ram_bytes; in btrfs_drop_extent_map_range()
923 split->disk_num_bytes = 0; in btrfs_drop_extent_map_range()
924 split->offset = 0; in btrfs_drop_extent_map_range()
925 split->ram_bytes = split->len; in btrfs_drop_extent_map_range()
956 * extent map - this is fine since if anyone needs it to in btrfs_drop_extent_map_range()
958 * load it again from the subvolume tree's file extent in btrfs_drop_extent_map_range()
962 * extent if it's new and needs to be logged. in btrfs_drop_extent_map_range()
964 if ((em->start < start || em_end > end) && modified) { in btrfs_drop_extent_map_range()
983 write_unlock(&em_tree->lock); in btrfs_drop_extent_map_range()
990 * Replace a range in the inode's extent map tree with a new extent map.
993 * @new_em: The new extent map to add to the inode's extent map tree.
997 * Drops all the extent maps in the inode's extent map tree that intersect the
999 * The caller should have locked an appropriate file range in the inode's io
1006 const u64 end = new_em->start + new_em->len - 1; in btrfs_replace_extent_map_range()
1007 struct extent_map_tree *tree = &inode->extent_tree; in btrfs_replace_extent_map_range()
1013 * The caller has locked an appropriate file range in the inode's io in btrfs_replace_extent_map_range()
1014 * tree, but getting -EEXIST when adding the new extent map can still in btrfs_replace_extent_map_range()
1021 btrfs_drop_extent_map_range(inode, new_em->start, end, false); in btrfs_replace_extent_map_range()
1022 write_lock(&tree->lock); in btrfs_replace_extent_map_range()
1024 write_unlock(&tree->lock); in btrfs_replace_extent_map_range()
1025 } while (ret == -EEXIST); in btrfs_replace_extent_map_range()
1039 struct extent_map_tree *em_tree = &inode->extent_tree; in split_extent_map()
1051 return -ENOMEM; in split_extent_map()
1054 ret = -ENOMEM; in split_extent_map()
1058 lock_extent(&inode->io_tree, start, start + len - 1, NULL); in split_extent_map()
1059 write_lock(&em_tree->lock); in split_extent_map()
1062 ret = -EIO; in split_extent_map()
1066 ASSERT(em->len == len); in split_extent_map()
1068 ASSERT(em->disk_bytenr < EXTENT_MAP_LAST_BYTE); in split_extent_map()
1069 ASSERT(em->flags & EXTENT_FLAG_PINNED); in split_extent_map()
1070 ASSERT(!(em->flags & EXTENT_FLAG_LOGGING)); in split_extent_map()
1071 ASSERT(!list_empty(&em->list)); in split_extent_map()
1073 flags = em->flags; in split_extent_map()
1074 em->flags &= ~EXTENT_FLAG_PINNED; in split_extent_map()
1076 /* First, replace the em with a new extent_map starting from * em->start */ in split_extent_map()
1077 split_pre->start = em->start; in split_extent_map()
1078 split_pre->len = pre; in split_extent_map()
1079 split_pre->disk_bytenr = new_logical; in split_extent_map()
1080 split_pre->disk_num_bytes = split_pre->len; in split_extent_map()
1081 split_pre->offset = 0; in split_extent_map()
1082 split_pre->ram_bytes = split_pre->len; in split_extent_map()
1083 split_pre->flags = flags; in split_extent_map()
1084 split_pre->generation = em->generation; in split_extent_map()
1090 * [em->start, em->start + pre] in split_extent_map()
1094 split_mid->start = em->start + pre; in split_extent_map()
1095 split_mid->len = em->len - pre; in split_extent_map()
1096 split_mid->disk_bytenr = extent_map_block_start(em) + pre; in split_extent_map()
1097 split_mid->disk_num_bytes = split_mid->len; in split_extent_map()
1098 split_mid->offset = 0; in split_extent_map()
1099 split_mid->ram_bytes = split_mid->len; in split_extent_map()
1100 split_mid->flags = flags; in split_extent_map()
1101 split_mid->generation = em->generation; in split_extent_map()
1110 write_unlock(&em_tree->lock); in split_extent_map()
1111 unlock_extent(&inode->io_tree, start, start + len - 1, NULL); in split_extent_map()
1125 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_scan_inode()
1127 struct extent_map_tree *tree = &inode->extent_tree; in btrfs_scan_inode()
1134 * in case we have to remove extent maps in the tree's list of modified in btrfs_scan_inode()
1150 if (!down_read_trylock(&inode->i_mmap_lock)) in btrfs_scan_inode()
1155 * waiting for it - either some task is about to do IO for the inode or in btrfs_scan_inode()
1159 if (!write_trylock(&tree->lock)) { in btrfs_scan_inode()
1160 up_read(&inode->i_mmap_lock); in btrfs_scan_inode()
1164 node = rb_first(&tree->root); in btrfs_scan_inode()
1170 ctx->scanned++; in btrfs_scan_inode()
1172 if (em->flags & EXTENT_FLAG_PINNED) in btrfs_scan_inode()
1182 if (!list_empty(&em->list) && em->generation >= cur_fs_gen) in btrfs_scan_inode()
1191 if (ctx->scanned >= ctx->nr_to_scan) in btrfs_scan_inode()
1195 * Stop if we need to reschedule or there's contention on the in btrfs_scan_inode()
1199 if (need_resched() || rwlock_needbreak(&tree->lock) || in btrfs_scan_inode()
1204 write_unlock(&tree->lock); in btrfs_scan_inode()
1205 up_read(&inode->i_mmap_lock); in btrfs_scan_inode()
1212 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_scan_root()
1215 u64 min_ino = fs_info->em_shrinker_last_ino + 1; in btrfs_scan_root()
1222 fs_info->em_shrinker_last_ino = btrfs_ino(inode); in btrfs_scan_root()
1225 if (ctx->scanned >= ctx->nr_to_scan || in btrfs_scan_root()
1226 btrfs_fs_closing(inode->root->fs_info)) in btrfs_scan_root()
1242 fs_info->em_shrinker_last_root = btrfs_root_id(root); in btrfs_scan_root()
1248 fs_info->em_shrinker_last_ino = 0; in btrfs_scan_root()
1249 fs_info->em_shrinker_last_root = btrfs_root_id(root) + 1; in btrfs_scan_root()
1267 ctx.nr_to_scan = atomic64_read(&fs_info->em_shrinker_nr_to_scan); in btrfs_extent_map_shrinker_worker()
1269 start_root_id = fs_info->em_shrinker_last_root; in btrfs_extent_map_shrinker_worker()
1270 next_root_id = fs_info->em_shrinker_last_root; in btrfs_extent_map_shrinker_worker()
1273 s64 nr = percpu_counter_sum_positive(&fs_info->evictable_extent_maps); in btrfs_extent_map_shrinker_worker()
1284 spin_lock(&fs_info->fs_roots_radix_lock); in btrfs_extent_map_shrinker_worker()
1285 count = radix_tree_gang_lookup(&fs_info->fs_roots_radix, in btrfs_extent_map_shrinker_worker()
1289 spin_unlock(&fs_info->fs_roots_radix_lock); in btrfs_extent_map_shrinker_worker()
1292 fs_info->em_shrinker_last_root = 0; in btrfs_extent_map_shrinker_worker()
1293 fs_info->em_shrinker_last_ino = 0; in btrfs_extent_map_shrinker_worker()
1301 spin_unlock(&fs_info->fs_roots_radix_lock); in btrfs_extent_map_shrinker_worker()
1313 s64 nr = percpu_counter_sum_positive(&fs_info->evictable_extent_maps); in btrfs_extent_map_shrinker_worker()
1318 atomic64_set(&fs_info->em_shrinker_nr_to_scan, 0); in btrfs_extent_map_shrinker_worker()
1334 * That's why we set the atomic counter to nr_to_scan only if its in btrfs_free_extent_maps()
1338 if (atomic64_cmpxchg(&fs_info->em_shrinker_nr_to_scan, 0, nr_to_scan) != 0) in btrfs_free_extent_maps()
1341 queue_work(system_unbound_wq, &fs_info->em_shrinker_work); in btrfs_free_extent_maps()
1346 atomic64_set(&fs_info->em_shrinker_nr_to_scan, 0); in btrfs_init_extent_map_shrinker_work()
1347 INIT_WORK(&fs_info->em_shrinker_work, btrfs_extent_map_shrinker_worker); in btrfs_init_extent_map_shrinker_work()