mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
btrfs: move space_info_flag_to_str() to space-info.h
Move space_info_flag_to_str() to space-info.h and as it now isn't static to space-info.c any more prefix it with 'btrfs_'. This way it can be re-used in other places. Reviewed-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
6a5ac228d4
commit
2ef2e97fe7
|
|
@ -606,22 +606,6 @@ do { \
|
|||
spin_unlock(&__rsv->lock); \
|
||||
} while (0)
|
||||
|
||||
static const char *space_info_flag_to_str(const struct btrfs_space_info *space_info)
|
||||
{
|
||||
switch (space_info->flags) {
|
||||
case BTRFS_BLOCK_GROUP_SYSTEM:
|
||||
return "SYSTEM";
|
||||
case BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA:
|
||||
return "DATA+METADATA";
|
||||
case BTRFS_BLOCK_GROUP_DATA:
|
||||
return "DATA";
|
||||
case BTRFS_BLOCK_GROUP_METADATA:
|
||||
return "METADATA";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_global_block_rsv(struct btrfs_fs_info *fs_info)
|
||||
{
|
||||
DUMP_BLOCK_RSV(fs_info, global_block_rsv);
|
||||
|
|
@ -634,7 +618,7 @@ static void dump_global_block_rsv(struct btrfs_fs_info *fs_info)
|
|||
static void __btrfs_dump_space_info(const struct btrfs_space_info *info)
|
||||
{
|
||||
const struct btrfs_fs_info *fs_info = info->fs_info;
|
||||
const char *flag_str = space_info_flag_to_str(info);
|
||||
const char *flag_str = btrfs_space_info_type_str(info);
|
||||
lockdep_assert_held(&info->lock);
|
||||
|
||||
/* The free space could be negative in case of overcommit */
|
||||
|
|
|
|||
|
|
@ -307,4 +307,20 @@ int btrfs_calc_reclaim_threshold(const struct btrfs_space_info *space_info);
|
|||
void btrfs_reclaim_sweep(const struct btrfs_fs_info *fs_info);
|
||||
void btrfs_return_free_space(struct btrfs_space_info *space_info, u64 len);
|
||||
|
||||
static inline const char *btrfs_space_info_type_str(const struct btrfs_space_info *space_info)
|
||||
{
|
||||
switch (space_info->flags) {
|
||||
case BTRFS_BLOCK_GROUP_SYSTEM:
|
||||
return "SYSTEM";
|
||||
case BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA:
|
||||
return "DATA+METADATA";
|
||||
case BTRFS_BLOCK_GROUP_DATA:
|
||||
return "DATA";
|
||||
case BTRFS_BLOCK_GROUP_METADATA:
|
||||
return "METADATA";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* BTRFS_SPACE_INFO_H */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user