mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-05 13:09:33 +00:00
btrfs-progs: zoned: implement sequential extent allocation
Implement a sequential extent allocator for zoned filesystems. This allocator only needs to check if there is enough space in the block group after the allocation pointer to satisfy the extent allocation request. Since the allocator is really simple, we implement it directly in find_search_start(). Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f08410f078
commit
50ae9f62c7
@ -284,6 +284,14 @@ again:
|
||||
if (cache->ro || !block_group_bits(cache, data))
|
||||
goto new_group;
|
||||
|
||||
if (btrfs_is_zoned(root->fs_info)) {
|
||||
if (cache->length - cache->alloc_offset < num)
|
||||
goto new_group;
|
||||
*start_ret = cache->start + cache->alloc_offset;
|
||||
cache->alloc_offset += num;
|
||||
return 0;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
ret = find_first_extent_bit(&root->fs_info->free_space_cache,
|
||||
last, &start, &end, EXTENT_DIRTY);
|
||||
|
Loading…
Reference in New Issue
Block a user