From: Zygo Blaxell Date: Wed, 9 Jul 2025 05:09:09 +0000 (-0400) Subject: fs: add btrfs_inode_flags_ntoa X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9e6870de89a00d483bfb18f412a5273bb5650f0;p=bees fs: add btrfs_inode_flags_ntoa Signed-off-by: Zygo Blaxell --- diff --git a/include/crucible/fs.h b/include/crucible/fs.h index 8dfdf921..a5902c17 100644 --- a/include/crucible/fs.h +++ b/include/crucible/fs.h @@ -208,6 +208,7 @@ namespace crucible { ostream & operator<<(ostream &os, const BtrfsIoctlSearchKey &key); string btrfs_chunk_type_ntoa(uint64_t type); + string btrfs_inode_flags_ntoa(uint64_t inode_flags); string btrfs_search_type_ntoa(unsigned type); string btrfs_search_objectid_ntoa(uint64_t objectid); string btrfs_compress_type_ntoa(uint8_t type); diff --git a/lib/fs.cc b/lib/fs.cc index 23ecb671..356d8031 100644 --- a/lib/fs.cc +++ b/lib/fs.cc @@ -987,6 +987,28 @@ namespace crucible { return bits_ntoa(objectid, table); } + string + btrfs_inode_flags_ntoa(uint64_t const inode_flags) + { + static const bits_ntoa_table table[] = { + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_NODATASUM), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_NODATACOW), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_READONLY), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_NOCOMPRESS), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_PREALLOC), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_SYNC), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_IMMUTABLE), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_APPEND), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_NODUMP), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_NOATIME), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_DIRSYNC), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_COMPRESS), + NTOA_TABLE_ENTRY_BITS(BTRFS_INODE_ROOT_ITEM_INIT), + NTOA_TABLE_ENTRY_END() + }; + return bits_ntoa(inode_flags, table); + } + ostream & operator<<(ostream &os, const btrfs_ioctl_search_key &key) {