Lines Matching refs:ctl

33 	struct btrfs_free_space_ctl *ctl = root->free_ino_ctl;  in caching_kthread()  local
107 __btrfs_add_free_space(ctl, last + 1, in caching_kthread()
118 __btrfs_add_free_space(ctl, last + 1, in caching_kthread()
139 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in start_caching() local
173 __btrfs_add_free_space(ctl, objectid, in start_caching()
247 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_unpin_free_ino() local
280 __btrfs_add_free_space(ctl, info->offset, count); in btrfs_unpin_free_ino()
292 static void recalculate_thresholds(struct btrfs_free_space_ctl *ctl) in recalculate_thresholds() argument
299 n = rb_last(&ctl->free_space_offset); in recalculate_thresholds()
301 ctl->extents_thresh = INIT_THRESHOLD; in recalculate_thresholds()
314 if (max_bitmaps <= ctl->total_bitmaps) { in recalculate_thresholds()
315 ctl->extents_thresh = 0; in recalculate_thresholds()
319 ctl->extents_thresh = (max_bitmaps - ctl->total_bitmaps) * in recalculate_thresholds()
327 static bool use_bitmap(struct btrfs_free_space_ctl *ctl, in use_bitmap() argument
330 if (ctl->free_extents < ctl->extents_thresh || in use_bitmap()
342 static void pinned_recalc_thresholds(struct btrfs_free_space_ctl *ctl) in pinned_recalc_thresholds() argument
346 static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl, in pinned_use_bitmap() argument
366 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_init_free_ino_ctl() local
369 spin_lock_init(&ctl->tree_lock); in btrfs_init_free_ino_ctl()
370 ctl->unit = 1; in btrfs_init_free_ino_ctl()
371 ctl->start = 0; in btrfs_init_free_ino_ctl()
372 ctl->private = NULL; in btrfs_init_free_ino_ctl()
373 ctl->op = &free_ino_op; in btrfs_init_free_ino_ctl()
374 INIT_LIST_HEAD(&ctl->trimming_ranges); in btrfs_init_free_ino_ctl()
375 mutex_init(&ctl->cache_writeout_mutex); in btrfs_init_free_ino_ctl()
382 ctl->extents_thresh = INIT_THRESHOLD; in btrfs_init_free_ino_ctl()
395 struct btrfs_free_space_ctl *ctl = root->free_ino_ctl; in btrfs_save_ino_cache() local
482 spin_lock(&ctl->tree_lock); in btrfs_save_ino_cache()
483 prealloc = sizeof(struct btrfs_free_space) * ctl->free_extents; in btrfs_save_ino_cache()
485 prealloc += ctl->total_bitmaps * PAGE_CACHE_SIZE; in btrfs_save_ino_cache()
486 spin_unlock(&ctl->tree_lock); in btrfs_save_ino_cache()