diff options
author | Stefan Roesch <shr@fb.com> | 2022-02-08 11:31:20 -0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-07-25 17:45:32 +0200 |
commit | f6fca3917b4d99d8c13901738afec35f570a3c2f (patch) | |
tree | 23209c8ca9e98df1abfa6a48afcfca15f7448b40 /fs/btrfs/space-info.h | |
parent | 71b68e9e35827a3f0ba3742cd1b10c1fceea55d7 (diff) |
btrfs: store chunk size in space-info struct
The chunk size is stored in the btrfs_space_info structure. It is
initialized at the start and is then used.
A new API is added to update the current chunk size. This API is used
to be able to expose the chunk_size as a sysfs setting.
Signed-off-by: Stefan Roesch <shr@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ rename and merge helpers, switch atomic type to u64, style fixes ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/space-info.h')
-rw-r--r-- | fs/btrfs/space-info.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h index c096695598c1..e7de24a529cf 100644 --- a/fs/btrfs/space-info.h +++ b/fs/btrfs/space-info.h @@ -25,6 +25,8 @@ struct btrfs_space_info { u64 max_extent_size; /* This will hold the maximum extent size of the space info if we had an ENOSPC in the allocator. */ + /* Chunk size in bytes */ + u64 chunk_size; /* * Once a block group drops below this threshold (percents) we'll @@ -123,6 +125,8 @@ void btrfs_update_space_info(struct btrfs_fs_info *info, u64 flags, u64 total_bytes, u64 bytes_used, u64 bytes_readonly, u64 bytes_zone_unusable, struct btrfs_space_info **space_info); +void btrfs_update_space_info_chunk_size(struct btrfs_space_info *space_info, + u64 chunk_size); struct btrfs_space_info *btrfs_find_space_info(struct btrfs_fs_info *info, u64 flags); u64 __pure btrfs_space_info_used(struct btrfs_space_info *s_info, |