summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsprim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfs/btrfsprim')
-rw-r--r--lib/btrfs/btrfsprim/itemtype.go64
-rw-r--r--lib/btrfs/btrfsprim/objid.go56
2 files changed, 60 insertions, 60 deletions
diff --git a/lib/btrfs/btrfsprim/itemtype.go b/lib/btrfs/btrfsprim/itemtype.go
index 0b6baee..dba7ced 100644
--- a/lib/btrfs/btrfsprim/itemtype.go
+++ b/lib/btrfs/btrfsprim/itemtype.go
@@ -7,38 +7,38 @@ import "fmt"
type ItemType uint8
const (
- BLOCK_GROUP_ITEM_KEY = ItemType(192)
- CHUNK_ITEM_KEY = ItemType(228)
- DEV_EXTENT_KEY = ItemType(204)
- DEV_ITEM_KEY = ItemType(216)
- DIR_INDEX_KEY = ItemType(96)
- DIR_ITEM_KEY = ItemType(84)
- EXTENT_CSUM_KEY = ItemType(128)
- EXTENT_DATA_KEY = ItemType(108)
- EXTENT_DATA_REF_KEY = ItemType(178)
- EXTENT_ITEM_KEY = ItemType(168)
- FREE_SPACE_BITMAP_KEY = ItemType(200)
- FREE_SPACE_EXTENT_KEY = ItemType(199)
- FREE_SPACE_INFO_KEY = ItemType(198)
- INODE_ITEM_KEY = ItemType(1)
- INODE_REF_KEY = ItemType(12)
- METADATA_ITEM_KEY = ItemType(169)
- ORPHAN_ITEM_KEY = ItemType(48)
- PERSISTENT_ITEM_KEY = ItemType(249)
- QGROUP_INFO_KEY = ItemType(242)
- QGROUP_LIMIT_KEY = ItemType(244)
- QGROUP_RELATION_KEY = ItemType(246)
- QGROUP_STATUS_KEY = ItemType(240)
- ROOT_BACKREF_KEY = ItemType(144)
- ROOT_ITEM_KEY = ItemType(132)
- ROOT_REF_KEY = ItemType(156)
- SHARED_BLOCK_REF_KEY = ItemType(182)
- SHARED_DATA_REF_KEY = ItemType(184)
- TREE_BLOCK_REF_KEY = ItemType(176)
- UNTYPED_KEY = ItemType(0)
- UUID_RECEIVED_SUBVOL_KEY = ItemType(252)
- UUID_SUBVOL_KEY = ItemType(251)
- XATTR_ITEM_KEY = ItemType(24)
+ BLOCK_GROUP_ITEM_KEY ItemType = 192
+ CHUNK_ITEM_KEY ItemType = 228
+ DEV_EXTENT_KEY ItemType = 204
+ DEV_ITEM_KEY ItemType = 216
+ DIR_INDEX_KEY ItemType = 96
+ DIR_ITEM_KEY ItemType = 84
+ EXTENT_CSUM_KEY ItemType = 128
+ EXTENT_DATA_KEY ItemType = 108
+ EXTENT_DATA_REF_KEY ItemType = 178
+ EXTENT_ITEM_KEY ItemType = 168
+ FREE_SPACE_BITMAP_KEY ItemType = 200
+ FREE_SPACE_EXTENT_KEY ItemType = 199
+ FREE_SPACE_INFO_KEY ItemType = 198
+ INODE_ITEM_KEY ItemType = 1
+ INODE_REF_KEY ItemType = 12
+ METADATA_ITEM_KEY ItemType = 169
+ ORPHAN_ITEM_KEY ItemType = 48
+ PERSISTENT_ITEM_KEY ItemType = 249
+ QGROUP_INFO_KEY ItemType = 242
+ QGROUP_LIMIT_KEY ItemType = 244
+ QGROUP_RELATION_KEY ItemType = 246
+ QGROUP_STATUS_KEY ItemType = 240
+ ROOT_BACKREF_KEY ItemType = 144
+ ROOT_ITEM_KEY ItemType = 132
+ ROOT_REF_KEY ItemType = 156
+ SHARED_BLOCK_REF_KEY ItemType = 182
+ SHARED_DATA_REF_KEY ItemType = 184
+ TREE_BLOCK_REF_KEY ItemType = 176
+ UNTYPED_KEY ItemType = 0
+ UUID_RECEIVED_SUBVOL_KEY ItemType = 252
+ UUID_SUBVOL_KEY ItemType = 251
+ XATTR_ITEM_KEY ItemType = 24
)
func (t ItemType) String() string {
diff --git a/lib/btrfs/btrfsprim/objid.go b/lib/btrfs/btrfsprim/objid.go
index 8ad290b..5896030 100644
--- a/lib/btrfs/btrfsprim/objid.go
+++ b/lib/btrfs/btrfsprim/objid.go
@@ -14,45 +14,45 @@ const maxUint64pp = 0x1_00000000_00000000
const (
// The IDs of the various trees
- ROOT_TREE_OBJECTID = ObjID(1) // holds pointers to all of the tree roots
- EXTENT_TREE_OBJECTID = ObjID(2) // stores information about which extents are in use, and reference counts
- CHUNK_TREE_OBJECTID = ObjID(3) // chunk tree stores translations from logical -> physical block numbering
- DEV_TREE_OBJECTID = ObjID(4) // stores info about which areas of a given device are in use; one per device
- FS_TREE_OBJECTID = ObjID(5) // one per subvolume, storing files and directories
- ROOT_TREE_DIR_OBJECTID = ObjID(6) // directory objectid inside the root tree
- CSUM_TREE_OBJECTID = ObjID(7) // holds checksums of all the data extents
- QUOTA_TREE_OBJECTID = ObjID(8)
- UUID_TREE_OBJECTID = ObjID(9) // for storing items that use the UUID_*_KEY
- FREE_SPACE_TREE_OBJECTID = ObjID(10) // tracks free space in block groups.
- BLOCK_GROUP_TREE_OBJECTID = ObjID(11) // hold the block group items.
+ ROOT_TREE_OBJECTID ObjID = 1 // holds pointers to all of the tree roots
+ EXTENT_TREE_OBJECTID ObjID = 2 // stores information about which extents are in use, and reference counts
+ CHUNK_TREE_OBJECTID ObjID = 3 // chunk tree stores translations from logical -> physical block numbering
+ DEV_TREE_OBJECTID ObjID = 4 // stores info about which areas of a given device are in use; one per device
+ FS_TREE_OBJECTID ObjID = 5 // one per subvolume, storing files and directories
+ ROOT_TREE_DIR_OBJECTID ObjID = 6 // directory objectid inside the root tree
+ CSUM_TREE_OBJECTID ObjID = 7 // holds checksums of all the data extents
+ QUOTA_TREE_OBJECTID ObjID = 8
+ UUID_TREE_OBJECTID ObjID = 9 // for storing items that use the UUID_*_KEY
+ FREE_SPACE_TREE_OBJECTID ObjID = 10 // tracks free space in block groups.
+ BLOCK_GROUP_TREE_OBJECTID ObjID = 11 // hold the block group items.
// Objects in the DEV_TREE
- DEV_STATS_OBJECTID = ObjID(0) // device stats in the device tree
+ DEV_STATS_OBJECTID ObjID = 0 // device stats in the device tree
// ???
- BALANCE_OBJECTID = ObjID(maxUint64pp - 4) // for storing balance parameters in the root tree
- ORPHAN_OBJECTID = ObjID(maxUint64pp - 5) // orphan objectid for tracking unlinked/truncated files
- TREE_LOG_OBJECTID = ObjID(maxUint64pp - 6) // does write ahead logging to speed up fsyncs
- TREE_LOG_FIXUP_OBJECTID = ObjID(maxUint64pp - 7)
- TREE_RELOC_OBJECTID = ObjID(maxUint64pp - 8) // space balancing
- DATA_RELOC_TREE_OBJECTID = ObjID(maxUint64pp - 9)
- EXTENT_CSUM_OBJECTID = ObjID(maxUint64pp - 10) // extent checksums all have this objectid
- FREE_SPACE_OBJECTID = ObjID(maxUint64pp - 11) // For storing free space cache
- FREE_INO_OBJECTID = ObjID(maxUint64pp - 12) // stores the inode number for the free-ino cache
-
- MULTIPLE_OBJECTIDS = ObjID(maxUint64pp - 255) // dummy objectid represents multiple objectids
+ BALANCE_OBJECTID ObjID = maxUint64pp - 4 // for storing balance parameters in the root tree
+ ORPHAN_OBJECTID ObjID = maxUint64pp - 5 // orphan objectid for tracking unlinked/truncated files
+ TREE_LOG_OBJECTID ObjID = maxUint64pp - 6 // does write ahead logging to speed up fsyncs
+ TREE_LOG_FIXUP_OBJECTID ObjID = maxUint64pp - 7
+ TREE_RELOC_OBJECTID ObjID = maxUint64pp - 8 // space balancing
+ DATA_RELOC_TREE_OBJECTID ObjID = maxUint64pp - 9
+ EXTENT_CSUM_OBJECTID ObjID = maxUint64pp - 10 // extent checksums all have this objectid
+ FREE_SPACE_OBJECTID ObjID = maxUint64pp - 11 // For storing free space cache
+ FREE_INO_OBJECTID ObjID = maxUint64pp - 12 // stores the inode number for the free-ino cache
+
+ MULTIPLE_OBJECTIDS ObjID = maxUint64pp - 255 // dummy objectid represents multiple objectids
// All files have objectids in this range.
- FIRST_FREE_OBJECTID = ObjID(256)
- LAST_FREE_OBJECTID = ObjID(maxUint64pp - 256)
+ FIRST_FREE_OBJECTID ObjID = 256
+ LAST_FREE_OBJECTID ObjID = maxUint64pp - 256
- FIRST_CHUNK_TREE_OBJECTID = ObjID(256)
+ FIRST_CHUNK_TREE_OBJECTID ObjID = 256
// Objects in the CHUNK_TREE
- DEV_ITEMS_OBJECTID = ObjID(1)
+ DEV_ITEMS_OBJECTID ObjID = 1
// ???
- EMPTY_SUBVOL_DIR_OBJECTID = ObjID(2)
+ EMPTY_SUBVOL_DIR_OBJECTID ObjID = 2
)
func (id ObjID) Format(typ ItemType) string {