Lines Matching refs:ctl
19 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in caching_kthread() local
93 __btrfs_add_free_space(fs_info, ctl, last + 1, in caching_kthread()
104 __btrfs_add_free_space(fs_info, ctl, last + 1, in caching_kthread()
126 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in start_caching() local
160 __btrfs_add_free_space(fs_info, ctl, objectid, in start_caching()
235 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_unpin_free_ino() local
265 __btrfs_add_free_space(root->fs_info, ctl, in btrfs_unpin_free_ino()
278 static void recalculate_thresholds(struct btrfs_free_space_ctl *ctl) in recalculate_thresholds() argument
285 n = rb_last(&ctl->free_space_offset); in recalculate_thresholds()
287 ctl->extents_thresh = INIT_THRESHOLD; in recalculate_thresholds()
300 if (max_bitmaps <= ctl->total_bitmaps) { in recalculate_thresholds()
301 ctl->extents_thresh = 0; in recalculate_thresholds()
305 ctl->extents_thresh = (max_bitmaps - ctl->total_bitmaps) * in recalculate_thresholds()
313 static bool use_bitmap(struct btrfs_free_space_ctl *ctl, in use_bitmap() argument
316 if (ctl->free_extents < ctl->extents_thresh || in use_bitmap()
328 static void pinned_recalc_thresholds(struct btrfs_free_space_ctl *ctl) in pinned_recalc_thresholds() argument
332 static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl, in pinned_use_bitmap() argument
352 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_init_free_ino_ctl() local
355 spin_lock_init(&ctl->tree_lock); in btrfs_init_free_ino_ctl()
356 ctl->unit = 1; in btrfs_init_free_ino_ctl()
357 ctl->start = 0; in btrfs_init_free_ino_ctl()
358 ctl->private = NULL; in btrfs_init_free_ino_ctl()
359 ctl->op = &free_ino_op; in btrfs_init_free_ino_ctl()
360 INIT_LIST_HEAD(&ctl->trimming_ranges); in btrfs_init_free_ino_ctl()
361 mutex_init(&ctl->cache_writeout_mutex); in btrfs_init_free_ino_ctl()
368 ctl->extents_thresh = INIT_THRESHOLD; in btrfs_init_free_ino_ctl()
382 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_save_ino_cache() local
470 spin_lock(&ctl->tree_lock); in btrfs_save_ino_cache()
471 prealloc = sizeof(struct btrfs_free_space) * ctl->free_extents; in btrfs_save_ino_cache()
473 prealloc += ctl->total_bitmaps * PAGE_SIZE; in btrfs_save_ino_cache()
474 spin_unlock(&ctl->tree_lock); in btrfs_save_ino_cache()