mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
fs: add a ntoa function for chunk types
Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
440740201a
commit
c4ba6ec269
@ -206,6 +206,7 @@ namespace crucible {
|
|||||||
ostream & operator<<(ostream &os, const btrfs_ioctl_search_key &key);
|
ostream & operator<<(ostream &os, const btrfs_ioctl_search_key &key);
|
||||||
ostream & operator<<(ostream &os, const BtrfsIoctlSearchKey &key);
|
ostream & operator<<(ostream &os, const BtrfsIoctlSearchKey &key);
|
||||||
|
|
||||||
|
string btrfs_chunk_type_ntoa(uint64_t type);
|
||||||
string btrfs_search_type_ntoa(unsigned type);
|
string btrfs_search_type_ntoa(unsigned type);
|
||||||
string btrfs_search_objectid_ntoa(uint64_t objectid);
|
string btrfs_search_objectid_ntoa(uint64_t objectid);
|
||||||
string btrfs_compress_type_ntoa(uint8_t type);
|
string btrfs_compress_type_ntoa(uint8_t type);
|
||||||
|
20
lib/fs.cc
20
lib/fs.cc
@ -881,6 +881,26 @@ namespace crucible {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string
|
||||||
|
btrfs_chunk_type_ntoa(uint64_t type)
|
||||||
|
{
|
||||||
|
static const bits_ntoa_table table[] = {
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_DATA),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_METADATA),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_SYSTEM),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_DUP),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID0),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID1),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID10),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID1C3),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID1C4),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID5),
|
||||||
|
NTOA_TABLE_ENTRY_BITS(BTRFS_BLOCK_GROUP_RAID6),
|
||||||
|
NTOA_TABLE_ENTRY_END()
|
||||||
|
};
|
||||||
|
return bits_ntoa(type, table);
|
||||||
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
btrfs_search_type_ntoa(unsigned type)
|
btrfs_search_type_ntoa(unsigned type)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user