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()
253 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_unpin_free_ino() local
283 __btrfs_add_free_space(root->fs_info, ctl, in btrfs_unpin_free_ino()
296 static void recalculate_thresholds(struct btrfs_free_space_ctl *ctl) in recalculate_thresholds() argument
303 n = rb_last(&ctl->free_space_offset); in recalculate_thresholds()
305 ctl->extents_thresh = INIT_THRESHOLD; in recalculate_thresholds()
318 if (max_bitmaps <= ctl->total_bitmaps) { in recalculate_thresholds()
319 ctl->extents_thresh = 0; in recalculate_thresholds()
323 ctl->extents_thresh = (max_bitmaps - ctl->total_bitmaps) * in recalculate_thresholds()
331 static bool use_bitmap(struct btrfs_free_space_ctl *ctl, in use_bitmap() argument
334 if (ctl->free_extents < ctl->extents_thresh || in use_bitmap()
346 static void pinned_recalc_thresholds(struct btrfs_free_space_ctl *ctl) in pinned_recalc_thresholds() argument
350 static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl, in pinned_use_bitmap() argument
370 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_init_free_ino_ctl() local
373 spin_lock_init(&ctl->tree_lock); in btrfs_init_free_ino_ctl()
374 ctl->unit = 1; in btrfs_init_free_ino_ctl()
375 ctl->start = 0; in btrfs_init_free_ino_ctl()
376 ctl->private = NULL; in btrfs_init_free_ino_ctl()
377 ctl->op = &free_ino_op; in btrfs_init_free_ino_ctl()
378 INIT_LIST_HEAD(&ctl->trimming_ranges); in btrfs_init_free_ino_ctl()
379 mutex_init(&ctl->cache_writeout_mutex); in btrfs_init_free_ino_ctl()
386 ctl->extents_thresh = INIT_THRESHOLD; in btrfs_init_free_ino_ctl()
400 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_save_ino_cache() local
488 spin_lock(&ctl->tree_lock); in btrfs_save_ino_cache()
489 prealloc = sizeof(struct btrfs_free_space) * ctl->free_extents; in btrfs_save_ino_cache()
491 prealloc += ctl->total_bitmaps * PAGE_SIZE; in btrfs_save_ino_cache()
492 spin_unlock(&ctl->tree_lock); in btrfs_save_ino_cache()