Lines Matching refs:last_ptr
3681 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in find_free_extent_clustered() local
3686 cluster_bg = btrfs_lock_cluster(bg, last_ptr, ffe_ctl->delalloc); in find_free_extent_clustered()
3694 offset = btrfs_alloc_from_cluster(cluster_bg, last_ptr, in find_free_extent_clustered()
3699 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3705 WARN_ON(last_ptr->block_group != cluster_bg); in find_free_extent_clustered()
3720 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3726 btrfs_return_cluster_to_free_space(NULL, last_ptr); in find_free_extent_clustered()
3733 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3740 ret = btrfs_find_space_cluster(bg, last_ptr, ffe_ctl->search_start, in find_free_extent_clustered()
3744 offset = btrfs_alloc_from_cluster(bg, last_ptr, in find_free_extent_clustered()
3749 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3760 btrfs_return_cluster_to_free_space(NULL, last_ptr); in find_free_extent_clustered()
3761 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3772 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in find_free_extent_unclustered() local
3780 if (unlikely(last_ptr)) { in find_free_extent_unclustered()
3781 spin_lock(&last_ptr->lock); in find_free_extent_unclustered()
3782 last_ptr->fragmented = 1; in find_free_extent_unclustered()
3783 spin_unlock(&last_ptr->lock); in find_free_extent_unclustered()
3818 if (ffe_ctl->last_ptr && ffe_ctl->use_cluster) { in do_allocation_clustered()
4058 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in found_extent_clustered() local
4060 if (!ffe_ctl->use_cluster && last_ptr) { in found_extent_clustered()
4061 spin_lock(&last_ptr->lock); in found_extent_clustered()
4062 last_ptr->window_start = ins->objectid; in found_extent_clustered()
4063 spin_unlock(&last_ptr->lock); in found_extent_clustered()
4276 ffe_ctl->last_ptr = fetch_cluster_info(fs_info, space_info, in prepare_allocation_clustered()
4278 if (ffe_ctl->last_ptr) { in prepare_allocation_clustered()
4279 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in prepare_allocation_clustered() local
4281 spin_lock(&last_ptr->lock); in prepare_allocation_clustered()
4282 if (last_ptr->block_group) in prepare_allocation_clustered()
4283 ffe_ctl->hint_byte = last_ptr->window_start; in prepare_allocation_clustered()
4284 if (last_ptr->fragmented) { in prepare_allocation_clustered()
4290 ffe_ctl->hint_byte = last_ptr->window_start; in prepare_allocation_clustered()
4293 spin_unlock(&last_ptr->lock); in prepare_allocation_clustered()
4392 ffe_ctl->last_ptr = NULL; in find_free_extent()