Documentation ¶
Overview ¶
Package btrfsprim contains primitive btrfs datatypes, that all other btrfs sub-packages may make use of.
Index ¶
Constants ¶
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ItemType ¶
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 MAX_KEY ItemType = math.MaxUint8 )
type Key ¶
type Key struct { ObjectID ObjID `bin:"off=0x0, siz=0x8"` // Each tree has its own set of Object IDs. ItemType ItemType `bin:"off=0x8, siz=0x1"` Offset uint64 `bin:"off=0x9, siz=0x8"` // The meaning depends on the item type. binstruct.End `bin:"off=0x11"` }
func (Key) Format ¶
Format returns a human-friendly string representation of the Key, according to which tree it appears in.
The formatting of the key mimics print-tree.c:btrfs_print_key().
type ObjID ¶
type ObjID uint64
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. // Objects in the DEV_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 // All files have objectids in this range. FIRST_FREE_OBJECTID ObjID = 256 LAST_FREE_OBJECTID ObjID = maxUint64pp - 256 // Objects in the CHUNK_TREE DEV_ITEMS_OBJECTID ObjID = 1 FIRST_CHUNK_TREE_OBJECTID ObjID = 256 // ??? EMPTY_SUBVOL_DIR_OBJECTID ObjID = 2 MAX_OBJECTID ObjID = math.MaxUint64 )
type Time ¶
Click to show internal directories.
Click to hide internal directories.