Documentation ¶
Overview ¶
Package btrfs contains low-level bindings to the Btrfs filesystem. Most of the types and ioctl constants are generated from the Btrfs kernel headers.
Index ¶
- Constants
- Variables
- func Clone(src string, dest string, srcOffset uint64, destOffset uint64, size uint64) error
- func CreateSnapshot(source string, opts ...SnapshotOption) error
- func CreateSubvolume(path string) error
- func DeleteSnapshot(path string) error
- func DeleteSubvolume(path string, force bool) error
- func EnableVerity(path string, algorithm uint32, blockSize uint32, salt []byte, sig []byte) error
- func EncodedWrite(path string, op *EncodedWriteOp) error
- func FindDeviceForMount(mount string) (string, error)
- func IsBtrfs(path string) (bool, error)
- func IsSubvolume(path string) (bool, error)
- func IsSubvolumeReadOnly(path string) (bool, error)
- func Send(source string, opts ...SendOption) error
- func SetReceivedSubvolume(path string, uuid uuid.UUID, ctransid uint64) error
- func SetSubvolumeReadOnly(path string, readonly bool) error
- func SyncFilesystem(path string) error
- func UUIDTreeLookupID(path string, uuid uuid.UUID, typ LookupType) (id uint64, err error)
- func WalkBtrfsTree(path string, params SearchParams, fn TreeIterFunc) error
- type BtrfsDevItem
- type BtrfsDirItem
- type BtrfsDiskKey
- type BtrfsInodeItem
- type BtrfsInodeRef
- type BtrfsMount
- type BtrfsRootItem
- type BtrfsRootItem_V0
- type BtrfsRootRef
- type BtrfsTimespec
- type CompressionType
- type DeviceInfo
- type DeviceStats
- type EncodedWriteOp
- type FilesystemInfo
- type IoctlCmd
- type LookupType
- type ObjectID
- type RBNode
- type RBRoot
- func (r *RBRoot) FilterFromRoot(rootID ObjectID) *RBRoot
- func (r *RBRoot) InOrderIterate(f RBTreeIterFunc) error
- func (r *RBRoot) InsertRoot(info *RootInfo)
- func (r *RBRoot) LookupRoot(rootID ObjectID) *RootInfo
- func (r *RBRoot) PostOrderIterate(f RBTreeIterFunc) error
- func (r *RBRoot) PreOrderIterate(f RBTreeIterFunc) error
- func (r *RBRoot) UpdateRoot(info *RootInfo) bool
- type RBTreeIterFunc
- type RootInfo
- type SearchArgs
- type SearchHeader
- type SearchKey
- type SearchOption
- type SearchParams
- type SendOption
- func SendCompressedData() SendOption
- func SendToFile(f *os.File) SendOption
- func SendToPath(path string) SendOption
- func SendToPipe() (SendOption, *os.File, error)
- func SendWithCloneSources(sources ...string) SendOption
- func SendWithLogger(logger *log.Logger, verbosity int) SendOption
- func SendWithParentRoot(root string) SendOption
- func SendWithoutData() SendOption
- type SnapshotOption
- type TreeItem
- func (t TreeItem) DevItem() (BtrfsDevItem, error)
- func (t TreeItem) DirItem() (BtrfsDirItem, error)
- func (t TreeItem) InodeItem() (BtrfsInodeItem, error)
- func (t TreeItem) InodeRef() (BtrfsInodeRef, error)
- func (t TreeItem) RootItem() (BtrfsRootItem, error)
- func (t TreeItem) RootRef() (BtrfsRootRef, string, error)
- type TreeIterFunc
Constants ¶
const ( IOC_NONE = 0x0 IOC_WRITE = 0x1 IOC_READ = 0x2 IOC_NRBITS = 8 IOC_TYPEBITS = 8 IOC_SIZEBITS = 14 IOC_DIRBITS = 2 IOC_NRSHIFT = 0 IOC_TYPESHIFT = IOC_NRSHIFT + IOC_NRBITS IOC_SIZESHIFT = IOC_TYPESHIFT + IOC_TYPEBITS IOC_DIRSHIFT = IOC_SIZESHIFT + IOC_SIZEBITS IOC_NRMASK = ((1 << IOC_NRBITS) - 1) IOC_TYPEMASK = ((1 << IOC_TYPEBITS) - 1) IOC_SIZEMASK = ((1 << IOC_SIZEBITS) - 1) IOC_DIRMASK = ((1 << IOC_DIRBITS) - 1) )
Generic ioctl constants
const ( SubvolReadOnly = 0x2 NoFileData = 0x1 OmitStreamHeader = 0x2 OmitEndCommand = 0x3 SendVersion = 0x8 SendCompressed = 0x10 RootTreeObjectID ObjectID = 0x1 ExtentTreeObjectID ObjectID = 0x2 ChunkTreeObjectID ObjectID = 0x3 DevTreeObjectID ObjectID = 0x4 FSTreeObjectID ObjectID = 0x5 RootTreeDirObjectID ObjectID = 0x6 CSumTreeObjectID ObjectID = 0x7 QuotaTreeObjectID ObjectID = 0x8 UUIDTreeObjectID ObjectID = 0x9 FreeSpaceTreeObjectID ObjectID = 0xa BlockGroupTreeObjectID ObjectID = 0xb DevStatsObjectID ObjectID = 0x0 BalanceObjectID ObjectID = 0xfffffffffffffffc OrphanObjectID ObjectID = 0xfffffffffffffffb TreeLogObjectID ObjectID = 0xfffffffffffffffa TreeLogFixupObjectID ObjectID = 0xfffffffffffffff9 TreeRelocObjectID ObjectID = 0xfffffffffffffff8 DataRelocTreeObjectID ObjectID = 0xfffffffffffffff7 ExtentCSumObjectID ObjectID = 0xfffffffffffffff6 FreeSpaceObjectID ObjectID = 0xfffffffffffffff5 FreeInoObjectID ObjectID = 0xfffffffffffffff4 MultipleObjectIDs ObjectID = 0xffffffffffffff01 FirstFreeObjectID ObjectID = 0x100 LastFreeObjectID ObjectID = 0xffffffffffffff00 DevItemsObjectID ObjectID = 0x1 DeviceItemKey SearchKey = 0xd8 DirItemKey SearchKey = 0x54 InodeRefKey SearchKey = 0xc InodeItemKey SearchKey = 0x1 RootItemKey SearchKey = 0x84 RootRefKey SearchKey = 0x9c RootBackrefKey SearchKey = 0x90 CompressionNone CompressionType = 0x0 CompressionZLib CompressionType = 0x1 CompressionZSTD CompressionType = 0x2 CompressionLZO4k CompressionType = 0x3 CompressionLZO8k CompressionType = 0x4 CompressionLZO16k CompressionType = 0x5 CompressionLZO32k CompressionType = 0x6 CompressionLZO64k CompressionType = 0x7 )
const (
BTRFS_IOCTL_MAGIC uintptr = 0x94
)
BTRFS ioctl constants
const BTRFS_SUPER_MAGIC = 0x9123683E
Variables ¶
var ( ErrInvalidUUID = errors.New("invalid UUID") ErrNotFound = errors.New("not found") )
var (
ErrEncryptionNotSupported = errors.New("encryption not supported")
)
var ( // ErrRootMountNotFound is returned when a root mount cannot be found for a given path. ErrRootMountNotFound = fmt.Errorf("could not find root mount for path") )
var ErrStopTreeIteration = fmt.Errorf("stop tree iteration")
var ErrStopWalk = fmt.Errorf("stop btrfs walk")
ErrStopWalk is an error that can be returned by the TreeIterFunc to stop the tree walk.
Functions ¶
func CreateSnapshot ¶
func CreateSnapshot(source string, opts ...SnapshotOption) error
CreateSnapshot creates a snapshot of the given subvolume with the given options.
func CreateSubvolume ¶
CreateSubvolume creates a subvolume at the given path.
func DeleteSnapshot ¶
DeleteSnapshot deletes the given snapshot.
func DeleteSubvolume ¶
DeleteSubvolume deletes the subvolume at the given path. If the subvolume is read-only then it will be made read-write before deletion.
func EnableVerity ¶
EnableVerity enables fs-verity on a path.
func EncodedWrite ¶
func EncodedWrite(path string, op *EncodedWriteOp) error
EncodedWrite writes encoded data to a file via ioctl.
func FindDeviceForMount ¶ added in v0.0.6
FindDeviceForMount returns the device for the given mount. In most circumstances this is analogous (but more expensive than) to calling FindRootMount.
func IsSubvolume ¶
IsSubvolume returns true if the given path is a subvolume.
func IsSubvolumeReadOnly ¶
IsSubvolumeReadOnly returns true if the subvolume at the given path is read-only.
func Send ¶
func Send(source string, opts ...SendOption) error
Send will send the snapshot at source with the given options. Source must be a path to a read-only snapshot.
func SetReceivedSubvolume ¶
SetReceivedSubvolume sets the received UUID and ctransid for a subvolume. This method is intended for use by receive operations.
func SetSubvolumeReadOnly ¶
SetSubvolumeReadOnly sets the read-only status of the subvolume at the given path to readonly.
func SyncFilesystem ¶
SyncFilesystem runs an I/O sync on the filesystem at the given path. If the path is not a BTRFS filesystem, an error will be returned.
func UUIDTreeLookupID ¶
UUIDTreeLookupID looks up the subvolume ID for the given UUID.
func WalkBtrfsTree ¶
func WalkBtrfsTree(path string, params SearchParams, fn TreeIterFunc) error
WalkBtrfsTree walks the Btrfs tree at the given path with the given search arguments. The TreeIterFunc is called for each item found in the tree.
Types ¶
type BtrfsDevItem ¶ added in v0.0.6
type BtrfsDirItem ¶
type BtrfsDirItem struct { Location BtrfsDiskKey Type uint8 }
type BtrfsDiskKey ¶
type BtrfsInodeItem ¶
type BtrfsInodeItem struct { Generation uint64 Transid uint64 Size uint64 Nbytes uint64 Group uint64 Nlink uint32 Uid uint32 Gid uint32 Mode uint32 Rdev uint64 Flags uint64 Sequence uint64 Reserved [4]uint64 Atime BtrfsTimespec Ctime BtrfsTimespec Mtime BtrfsTimespec Otime BtrfsTimespec }
type BtrfsInodeRef ¶
type BtrfsMount ¶ added in v0.0.6
BtrfsMount represents a mounted Btrfs filesystem.
func FindMountForDevice ¶ added in v0.0.6
func FindMountForDevice(device string) (*BtrfsMount, error)
FindMountForDevice returns the mount for the given device.
func FindRootMount ¶
func FindRootMount(path string) (*BtrfsMount, error)
FindRootMount returns the root btrfs mount for the given path.
func ListBtrfsMounts ¶ added in v0.0.5
func ListBtrfsMounts() ([]*BtrfsMount, error)
ListBtrfsMounts returns a list of all btrfs mounts on the system.
func (*BtrfsMount) DeviceInfo ¶ added in v0.0.6
func (b *BtrfsMount) DeviceInfo() (*DeviceInfo, error)
func (*BtrfsMount) DeviceStats ¶ added in v0.0.6
func (b *BtrfsMount) DeviceStats() (*DeviceStats, error)
func (*BtrfsMount) String ¶ added in v0.0.6
func (b *BtrfsMount) String() string
type BtrfsRootItem ¶
type BtrfsRootItem struct { Inode BtrfsInodeItem Generation uint64 Root_dirid uint64 Bytenr uint64 Byte_limit uint64 Bytes_used uint64 Last_snapshot uint64 Flags uint64 Refs uint32 DropProgress BtrfsDiskKey Drop_level uint8 Level uint8 GenerationV2 uint64 Uuid [16]uint8 Parent_uuid [16]uint8 Received_uuid [16]uint8 Ctransid uint64 Otransid uint64 Stransid uint64 Rtransid uint64 Ctime BtrfsTimespec Otime BtrfsTimespec Stime BtrfsTimespec Rtime BtrfsTimespec Global_tree_id uint64 Reserved [7]uint64 }
type BtrfsRootItem_V0 ¶
type BtrfsRootRef ¶
type BtrfsTimespec ¶
func (BtrfsTimespec) Time ¶ added in v0.0.5
func (b BtrfsTimespec) Time() time.Time
type CompressionType ¶
type CompressionType uint32
func (CompressionType) String ¶
func (i CompressionType) String() string
type DeviceInfo ¶
type DeviceInfo struct { DeviceID uint64 UUID uuid.UUID BytesUsed uint64 TotalBytes uint64 Path string }
func GetDeviceInfo ¶
func GetDeviceInfo(path string) (*DeviceInfo, error)
GetDeviceInfo returns information about the device at the given path or device.
type DeviceStats ¶ added in v0.0.6
type DeviceStats struct { WriteIOErrors uint64 ReadIOErrors uint64 FlushIOErrors uint64 CorruptionErrors uint64 GenerationErrors uint64 }
func GetDeviceStats ¶ added in v0.0.6
func GetDeviceStats(path string) (*DeviceStats, error)
GetDeviceStats returns statistics about the device at the given path or device.
type EncodedWriteOp ¶
type EncodedWriteOp struct { Offset uint64 Data []byte UnencodedFileLength uint64 UnencodedLength uint64 UnencodedOffset uint64 Compression CompressionType Encryption uint32 // Not supported yet }
EncodedWriteOp is an operation to write encoded data to a file.
func (*EncodedWriteOp) Decompress ¶
func (e *EncodedWriteOp) Decompress() ([]byte, error)
Decompress decompresses the data in the EncodedWriteOp.
type FilesystemInfo ¶
type FilesystemInfo struct { MaxID uint64 NumDevices uint64 FSID uuid.UUID NodeSize uint32 SectorSize uint32 CloneAlign uint32 CsumType uint16 CsumSize uint16 Flags uint64 Generate uint64 MetadataUUID uuid.UUID }
func GetFilesystemInfo ¶
func GetFilesystemInfo(path string) (*FilesystemInfo, error)
GetFilesystemInfo returns metadata about the filesystem at the given path. If the path is not a BTRFS filesystem, an error will be returned.
type IoctlCmd ¶
type IoctlCmd uintptr
IoctlCmd is a type cast of uintptr to make it more clear that it is an ioctl.
const ( FS_IOC_ENABLE_VERITY IoctlCmd = 0x40806685 FS_IOC_MEASURE_VERITY IoctlCmd = 0xc0046686 FS_IOC_READ_VERITY_METADATA IoctlCmd = 0xc0286687 )
Fsverity ioctl commands
const ( BTRFS_IOC_SNAP_CREATE IoctlCmd = 0x50009401 BTRFS_IOC_DEFRAG IoctlCmd = 0x50009402 BTRFS_IOC_RESIZE IoctlCmd = 0x50009403 BTRFS_IOC_SCAN_DEV IoctlCmd = 0x50009404 BTRFS_IOC_FORGET_DEV IoctlCmd = 0x50009405 BTRFS_IOC_TRANS_START IoctlCmd = 0x9406 BTRFS_IOC_TRANS_END IoctlCmd = 0x9407 BTRFS_IOC_SYNC IoctlCmd = 0x9408 BTRFS_IOC_CLONE IoctlCmd = 0x40049409 BTRFS_IOC_ADD_DEV IoctlCmd = 0x5000940a BTRFS_IOC_RM_DEV IoctlCmd = 0x5000940b BTRFS_IOC_BALANCE IoctlCmd = 0x5000940c BTRFS_IOC_CLONE_RANGE IoctlCmd = 0x4020940d BTRFS_IOC_SUBVOL_CREATE IoctlCmd = 0x5000940e BTRFS_IOC_SNAP_DESTROY IoctlCmd = 0x5000940f BTRFS_IOC_DEFRAG_RANGE IoctlCmd = 0x40309410 BTRFS_IOC_TREE_SEARCH IoctlCmd = 0xd0009411 BTRFS_IOC_TREE_SEARCH_V2 IoctlCmd = 0xc0709411 BTRFS_IOC_INO_LOOKUP IoctlCmd = 0xd0009412 BTRFS_IOC_DEFAULT_SUBVOL IoctlCmd = 0x40089413 BTRFS_IOC_SPACE_INFO IoctlCmd = 0xc0109414 BTRFS_IOC_START_SYNC IoctlCmd = 0x80089418 BTRFS_IOC_WAIT_SYNC IoctlCmd = 0x40089416 BTRFS_IOC_SNAP_CREATE_V2 IoctlCmd = 0x50009417 BTRFS_IOC_SUBVOL_CREATE_V2 IoctlCmd = 0x50009418 BTRFS_IOC_SUBVOL_GETFLAGS IoctlCmd = 0x80089419 BTRFS_IOC_SUBVOL_SETFLAGS IoctlCmd = 0x4008941a BTRFS_IOC_SCRUB IoctlCmd = 0xc400941b BTRFS_IOC_SCRUB_CANCEL IoctlCmd = 0x941c BTRFS_IOC_SCRUB_PROGRESS IoctlCmd = 0xc400941d BTRFS_IOC_DEV_INFO IoctlCmd = 0xd000941e BTRFS_IOC_FS_INFO IoctlCmd = 0x8400941f BTRFS_IOC_BALANCE_V2 IoctlCmd = 0xc4009420 BTRFS_IOC_BALANCE_CTL IoctlCmd = 0x40049421 BTRFS_IOC_BALANCE_PROGRESS IoctlCmd = 0x84009422 BTRFS_IOC_INO_PATHS IoctlCmd = 0xc0389423 BTRFS_IOC_LOGICAL_INO IoctlCmd = 0xc0389424 BTRFS_IOC_SET_RECEIVED_SUBVOL IoctlCmd = 0xc0c89425 BTRFS_IOC_SEND IoctlCmd = 0x40489426 BTRFS_IOC_DEVICES_READY IoctlCmd = 0x90009427 BTRFS_IOC_QUOTA_CTL IoctlCmd = 0xc0109428 BTRFS_IOC_QGROUP_ASSIGN IoctlCmd = 0x40189429 BTRFS_IOC_QGROUP_CREATE IoctlCmd = 0x4010942a BTRFS_IOC_QGROUP_LIMIT IoctlCmd = 0x8030942b BTRFS_IOC_QUOTA_RESCAN IoctlCmd = 0x4040942c BTRFS_IOC_QUOTA_RESCAN_STATUS IoctlCmd = 0x8040942d BTRFS_IOC_QUOTA_RESCAN_WAIT IoctlCmd = 0x942e BTRFS_IOC_GET_DEV_STATS IoctlCmd = 0xc4089434 BTRFS_IOC_DEV_REPLACE IoctlCmd = 0xca289435 BTRFS_IOC_FILE_EXTENT_SAME IoctlCmd = 0xc0189436 BTRFS_IOC_RM_DEV_V2 IoctlCmd = 0x5000943a BTRFS_IOC_LOGICAL_INO_V2 IoctlCmd = 0xc038943b BTRFS_IOC_GET_SUBVOL_INFO IoctlCmd = 0x81f8943c BTRFS_IOC_GET_SUBVOL_ROOTREF IoctlCmd = 0xd000943d BTRFS_IOC_INO_LOOKUP_USER IoctlCmd = 0xd000943e BTRFS_IOC_SNAP_DESTROY_V2 IoctlCmd = 0x5000943f BTRFS_IOC_ENCODED_READ IoctlCmd = 0x80809440 BTRFS_IOC_ENCODED_WRITE IoctlCmd = 0x40809440 )
BTRFS ioctl commands
type LookupType ¶
type LookupType uint8
const ( LookupUUIDKeySubvol LookupType = 251 LookupUUIDKeyReceivedSubvol LookupType = 252 )
type RBRoot ¶
type RBRoot struct {
RBNode *RBNode
}
RBRoot represents the root of the Btrfs tree.
func BuildRBTree ¶
BuildRBTree builds a red-black tree from the subvolume root tree. Colors are currently not assigned as they are not needed for the current implementation.
func (*RBRoot) FilterFromRoot ¶ added in v0.0.5
func (*RBRoot) InOrderIterate ¶
func (r *RBRoot) InOrderIterate(f RBTreeIterFunc) error
func (*RBRoot) InsertRoot ¶
func (*RBRoot) LookupRoot ¶
func (*RBRoot) PostOrderIterate ¶
func (r *RBRoot) PostOrderIterate(f RBTreeIterFunc) error
func (*RBRoot) PreOrderIterate ¶
func (r *RBRoot) PreOrderIterate(f RBTreeIterFunc) error
func (*RBRoot) UpdateRoot ¶
type RBTreeIterFunc ¶
RBTreeIterFunc is the function signature for the RBTreeIterFunc. Lasterr is the last error returned by the function. If the function returns an ErrStopTreeIteration error, the iteration will stop and the error will be returned by RBTree.Iterate.
type RootInfo ¶
type RootInfo struct { RBNode *RBNode RootID ObjectID RootOffset uint64 Flags uint64 RefTree ObjectID DirID uint64 TopID uint64 Generation uint64 OriginalGeneration uint64 CreationTime time.Time SendTime time.Time ReceiveTime time.Time UUID uuid.UUID ParentUUID uuid.UUID ReceivedUUID uuid.UUID Path string Name string // Only populated by resolving the path while building a tree. FullPath string Deleted bool // Only populated during SubvolumeSearch with SearchWithSnapshots Snapshots []*RootInfo // The underlying item and reference that built this info Item *BtrfsRootItem Ref *BtrfsRootRef }
RootInfo represents the information about a Btrfs root. RBNode contains a reference to the node in the tree.
func SubvolumeSearch ¶
func SubvolumeSearch(opts ...SearchOption) (*RootInfo, error)
SubvolumeSearch searches for a subvolume using the given options.
type SearchArgs ¶
type SearchArgs struct { Key SearchParams Buf [3992]int8 }
type SearchHeader ¶
func (*SearchHeader) ItemType ¶
func (s *SearchHeader) ItemType() SearchKey
type SearchOption ¶
type SearchOption func(*searchContext) error
func SearchWithPath ¶
func SearchWithPath(path string) SearchOption
SearchWithPath searches for a subvolume starting from the given path. Implies SearchWithRootMount and root detection with FindRootMount.
func SearchWithReceivedUUID ¶
func SearchWithReceivedUUID(uuid uuid.UUID) SearchOption
SearchWithReceivedUUID searches for a subvolume with the given received UUID.
func SearchWithRootID ¶
func SearchWithRootID(id uint64) SearchOption
SearchWithRootID searches for a subvolume starting from the given root ID.
func SearchWithRootMount ¶
func SearchWithRootMount(path string) SearchOption
SearchWithRootMount searches for a subvolume starting from the given root mount point. If not provided, the search will start from the root of the filesystem. You can use the FindRootMount function to find the root mount point of a given path.
func SearchWithSnapshots ¶
func SearchWithSnapshots() SearchOption
SearchWithSnapshots searches for snapshots of the given subvolume and populates the results with them.
func SearchWithUUID ¶
func SearchWithUUID(uuid uuid.UUID) SearchOption
SearchWithUUID searches for a subvolume with the given UUID.
type SearchParams ¶
type SendOption ¶
type SendOption func(*sendCtx) error
func SendToFile ¶
func SendToFile(f *os.File) SendOption
SendToFile will send a send stream to the given os.File.
func SendToPath ¶
func SendToPath(path string) SendOption
SendToPath will send a send stream to the given path as a file.
func SendToPipe ¶ added in v0.0.4
func SendToPipe() (SendOption, *os.File, error)
SendToPipe creates and returns an option and pipe to read the stream from.
func SendWithCloneSources ¶
func SendWithCloneSources(sources ...string) SendOption
SendWithCloneSources will use the given snapshots as clone sources for an incremental send.
func SendWithLogger ¶
func SendWithLogger(logger *log.Logger, verbosity int) SendOption
SendWithLogger will log the send operation to the given logger.
func SendWithParentRoot ¶
func SendWithParentRoot(root string) SendOption
SendWithParentRoot will send an incremental send from the given parent root.
func SendWithoutData ¶
func SendWithoutData() SendOption
SendWithoutData will send a send stream without any data. This is useful for getting a list of files that have changed.
type SnapshotOption ¶
type SnapshotOption func(*volumeArgsV2) error
func WithReadOnlySnapshot ¶
func WithReadOnlySnapshot() SnapshotOption
WithReadOnlySnapshot sets the snapshot to be read-only.
func WithSnapshotName ¶
func WithSnapshotName(name string) SnapshotOption
WithSnapshotName sets the name of the snapshot to be created.
func WithSnapshotPath ¶
func WithSnapshotPath(path string) SnapshotOption
WithSnapshotPath sets an absolute path for the snapshot to be created.
type TreeItem ¶
func (TreeItem) DevItem ¶ added in v0.0.6
func (t TreeItem) DevItem() (BtrfsDevItem, error)
func (TreeItem) DirItem ¶
func (t TreeItem) DirItem() (BtrfsDirItem, error)
func (TreeItem) InodeItem ¶
func (t TreeItem) InodeItem() (BtrfsInodeItem, error)
func (TreeItem) InodeRef ¶
func (t TreeItem) InodeRef() (BtrfsInodeRef, error)
func (TreeItem) RootItem ¶
func (t TreeItem) RootItem() (BtrfsRootItem, error)
type TreeIterFunc ¶
type TreeIterFunc func(hdr SearchHeader, item TreeItem, lastErr error) error
TreeIterFunc is a function that is called for each item found in the tree. If the function returns any error it is passed as lastErr to the next call of the function. If the error wraps the ErrStopWalk error, the iteration is stopped.
Source Files ¶
- btrfs_rb_tree.go
- btrfs_tree_item.go
- btrfs_tree_walk.go
- clone.go
- decompress.go
- device.go
- doc.go
- encoded_write.go
- filesystems_info.go
- fsverity.go
- ioctl.go
- mounts.go
- send.go
- snapshot.go
- subvolume.go
- subvolume_lookup.go
- subvolume_root_tree.go
- subvolume_search.go
- sync.go
- uuid_tree_lookup.go
- zz_ctypes_manual.go
- zz_ioctl_defs.go
- zz_ioctl_types.go
- zz_stringers.go
- zz_typegen.go