Lines Matching refs:last_ptr
3470 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in find_free_extent_clustered() local
3475 cluster_bg = btrfs_lock_cluster(bg, last_ptr, ffe_ctl->delalloc); in find_free_extent_clustered()
3482 offset = btrfs_alloc_from_cluster(cluster_bg, last_ptr, in find_free_extent_clustered()
3487 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3493 WARN_ON(last_ptr->block_group != cluster_bg); in find_free_extent_clustered()
3508 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3514 btrfs_return_cluster_to_free_space(NULL, last_ptr); in find_free_extent_clustered()
3521 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3528 ret = btrfs_find_space_cluster(bg, last_ptr, ffe_ctl->search_start, in find_free_extent_clustered()
3532 offset = btrfs_alloc_from_cluster(bg, last_ptr, in find_free_extent_clustered()
3537 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3544 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3556 btrfs_return_cluster_to_free_space(NULL, last_ptr); in find_free_extent_clustered()
3557 spin_unlock(&last_ptr->refill_lock); in find_free_extent_clustered()
3569 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in find_free_extent_unclustered() local
3577 if (unlikely(last_ptr)) { in find_free_extent_unclustered()
3578 spin_lock(&last_ptr->lock); in find_free_extent_unclustered()
3579 last_ptr->fragmented = 1; in find_free_extent_unclustered()
3580 spin_unlock(&last_ptr->lock); in find_free_extent_unclustered()
3632 if (ffe_ctl->last_ptr && ffe_ctl->use_cluster) { in do_allocation_clustered()
3868 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in found_extent_clustered() local
3870 if (!ffe_ctl->use_cluster && last_ptr) { in found_extent_clustered()
3871 spin_lock(&last_ptr->lock); in found_extent_clustered()
3872 last_ptr->window_start = ins->objectid; in found_extent_clustered()
3873 spin_unlock(&last_ptr->lock); in found_extent_clustered()
4104 ffe_ctl->last_ptr = fetch_cluster_info(fs_info, space_info, in prepare_allocation_clustered()
4106 if (ffe_ctl->last_ptr) { in prepare_allocation_clustered()
4107 struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr; in prepare_allocation_clustered() local
4109 spin_lock(&last_ptr->lock); in prepare_allocation_clustered()
4110 if (last_ptr->block_group) in prepare_allocation_clustered()
4111 ffe_ctl->hint_byte = last_ptr->window_start; in prepare_allocation_clustered()
4112 if (last_ptr->fragmented) { in prepare_allocation_clustered()
4118 ffe_ctl->hint_byte = last_ptr->window_start; in prepare_allocation_clustered()
4121 spin_unlock(&last_ptr->lock); in prepare_allocation_clustered()
4196 ffe_ctl->last_ptr = NULL; in find_free_extent()