Lines Matching +full:cache +full:- +full:block
1 /* SPDX-License-Identifier: GPL-2.0 */
6 #include "free-space-cache.h"
62 /* Block group flags set at runtime */
71 /* Does the block group need to be added to the free space tree? */
73 /* Indicate that the block group is placed on a sequential zone */
76 * Indicate that block group is in the list of new block groups of a
119 * The last committed used bytes of this block group, if the above @used
120 * is still the same as @commit_used, we don't need to update block
121 * group item of this block group.
125 * If the free space extent count exceeds this number, convert the block
132 * block group back to extents.
151 /* Cache tracking stuff */
157 /* Free space cache stuff */
160 /* Block group cache stuff */
163 /* For block groups in the same raid type */
169 * List of struct btrfs_free_clusters for this block group.
184 /* For read-only block groups */
188 * When non-zero it means the block group's logical address and its
189 * device extents can not be reused for future block group allocations
191 * reused while some task is still using the block group after it was
192 * deleted - we want to make sure they can only be reused for new block
193 * groups after that task is done with the deleted block group.
204 /* For dirty block groups */
214 * block group's range is created (after it's added to its inode's
226 * This is to prevent races between block group relocation and nocow
235 * Number of extents in this block group used for swap files.
241 * Allocation offset for the block group to implement sequential
257 return (block_group->start + block_group->length); in btrfs_block_group_end()
262 lockdep_assert_held(&bg->lock); in btrfs_is_block_group_used()
264 return (bg->used > 0 || bg->reserved > 0 || bg->pinned > 0); in btrfs_is_block_group_used()
272 * efficiency, so only proper data block groups are considered. in btrfs_is_block_group_data_only()
274 return (block_group->flags & BTRFS_BLOCK_GROUP_DATA) && in btrfs_is_block_group_data_only()
275 !(block_group->flags & BTRFS_BLOCK_GROUP_METADATA); in btrfs_is_block_group_data_only()
287 struct btrfs_block_group *cache);
288 void btrfs_get_block_group(struct btrfs_block_group *cache);
289 void btrfs_put_block_group(struct btrfs_block_group *cache);
297 void btrfs_wait_block_group_cache_progress(struct btrfs_block_group *cache,
299 int btrfs_cache_block_group(struct btrfs_block_group *cache, bool wait);
302 struct btrfs_block_group *cache);
320 int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
322 void btrfs_dec_block_group_ro(struct btrfs_block_group *cache);
328 int btrfs_add_reserved_bytes(struct btrfs_block_group *cache,
331 void btrfs_free_reserved_bytes(struct btrfs_block_group *cache,
360 static inline int btrfs_block_group_done(struct btrfs_block_group *cache) in btrfs_block_group_done() argument
363 return cache->cached == BTRFS_CACHE_FINISHED || in btrfs_block_group_done()
364 cache->cached == BTRFS_CACHE_ERROR; in btrfs_block_group_done()
367 void btrfs_freeze_block_group(struct btrfs_block_group *cache);
368 void btrfs_unfreeze_block_group(struct btrfs_block_group *cache);