Lines Matching refs:ctl
33 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in caching_kthread() local
109 __btrfs_add_free_space(fs_info, ctl, last + 1, in caching_kthread()
120 __btrfs_add_free_space(fs_info, ctl, last + 1, in caching_kthread()
142 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in start_caching() local
177 __btrfs_add_free_space(fs_info, ctl, objectid, in start_caching()
254 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_unpin_free_ino() local
284 __btrfs_add_free_space(root->fs_info, ctl, in btrfs_unpin_free_ino()
297 static void recalculate_thresholds(struct btrfs_free_space_ctl *ctl) in recalculate_thresholds() argument
304 n = rb_last(&ctl->free_space_offset); in recalculate_thresholds()
306 ctl->extents_thresh = INIT_THRESHOLD; in recalculate_thresholds()
319 if (max_bitmaps <= ctl->total_bitmaps) { in recalculate_thresholds()
320 ctl->extents_thresh = 0; in recalculate_thresholds()
324 ctl->extents_thresh = (max_bitmaps - ctl->total_bitmaps) * in recalculate_thresholds()
332 static bool use_bitmap(struct btrfs_free_space_ctl *ctl, in use_bitmap() argument
335 if (ctl->free_extents < ctl->extents_thresh || in use_bitmap()
347 static void pinned_recalc_thresholds(struct btrfs_free_space_ctl *ctl) in pinned_recalc_thresholds() argument
351 static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl, in pinned_use_bitmap() argument
371 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_init_free_ino_ctl() local
374 spin_lock_init(&ctl->tree_lock); in btrfs_init_free_ino_ctl()
375 ctl->unit = 1; in btrfs_init_free_ino_ctl()
376 ctl->start = 0; in btrfs_init_free_ino_ctl()
377 ctl->private = NULL; in btrfs_init_free_ino_ctl()
378 ctl->op = &free_ino_op; in btrfs_init_free_ino_ctl()
379 INIT_LIST_HEAD(&ctl->trimming_ranges); in btrfs_init_free_ino_ctl()
380 mutex_init(&ctl->cache_writeout_mutex); in btrfs_init_free_ino_ctl()
387 ctl->extents_thresh = INIT_THRESHOLD; in btrfs_init_free_ino_ctl()
401 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_save_ino_cache() local
489 spin_lock(&ctl->tree_lock); in btrfs_save_ino_cache()
490 prealloc = sizeof(struct btrfs_free_space) * ctl->free_extents; in btrfs_save_ino_cache()
492 prealloc += ctl->total_bitmaps * PAGE_SIZE; in btrfs_save_ino_cache()
493 spin_unlock(&ctl->tree_lock); in btrfs_save_ino_cache()