Documentation ¶
Overview ¶
Package btrfs (and its sub-packages) are the core implementation of the btrfs filesystem.
Index ¶
- Variables
- func ChecksumLogical(fs diskio.File[btrfsvol.LogicalAddr], alg btrfssum.CSumType, ...) (btrfssum.CSum, error)
- func ChecksumPhysical(dev *Device, alg btrfssum.CSumType, paddr btrfsvol.PhysicalAddr) (btrfssum.CSum, error)
- func ChecksumQualifiedPhysical(fs *FS, alg btrfssum.CSumType, paddr btrfsvol.QualifiedPhysicalAddr) (btrfssum.CSum, error)
- func LookupCSum(ctx context.Context, fs btrfstree.Forrest, alg btrfssum.CSumType, ...) (btrfssum.SumRun[btrfsvol.LogicalAddr], error)
- type BareInode
- type Device
- type Dir
- type FS
- func (fs *FS) AcquireNode(ctx context.Context, addr btrfsvol.LogicalAddr, exp btrfstree.NodeExpectations) (*btrfstree.Node, error)
- func (fs *FS) AddDevice(ctx context.Context, dev *Device) error
- func (fs *FS) Close() error
- func (fs *FS) ForrestLookup(ctx context.Context, treeID btrfsprim.ObjID) (btrfstree.Tree, error)
- func (fs *FS) Name() string
- func (fs *FS) RawTree(ctx context.Context, treeID btrfsprim.ObjID) (*btrfstree.RawTree, error)
- func (fs *FS) ReInit(ctx context.Context) error
- func (fs *FS) ReadAt(p []byte, off btrfsvol.LogicalAddr) (int, error)
- func (fs *FS) ReleaseNode(node *btrfstree.Node)
- func (fs *FS) Size() btrfsvol.LogicalAddr
- func (fs *FS) Superblock() (*btrfstree.Superblock, error)
- func (fs *FS) Superblocks() ([]*diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock], error)
- func (fs *FS) WriteAt(p []byte, off btrfsvol.LogicalAddr) (int, error)
- type File
- type FileExtent
- type FullInode
- type InodeRef
- type ReadableFS
- type Subvolume
- func (sv *Subvolume) AcquireBareInode(inode btrfsprim.ObjID) (*BareInode, error)
- func (sv *Subvolume) AcquireDir(inode btrfsprim.ObjID) (*Dir, error)
- func (sv *Subvolume) AcquireFile(inode btrfsprim.ObjID) (*File, error)
- func (sv *Subvolume) AcquireFullInode(inode btrfsprim.ObjID) (*FullInode, error)
- func (sv *Subvolume) GetRootInode() (btrfsprim.ObjID, error)
- func (sv *Subvolume) NewChildSubvolume(childID btrfsprim.ObjID) *Subvolume
- func (sv *Subvolume) ReleaseBareInode(inode btrfsprim.ObjID)
- func (sv *Subvolume) ReleaseDir(inode btrfsprim.ObjID)
- func (sv *Subvolume) ReleaseFile(inode btrfsprim.ObjID)
- func (sv *Subvolume) ReleaseFullInode(inode btrfsprim.ObjID)
Constants ¶
This section is empty.
Variables ¶
View Source
var SuperblockAddrs = []btrfsvol.PhysicalAddr{
0x00_0001_0000,
0x00_0400_0000,
0x40_0000_0000,
}
Functions ¶
func ChecksumLogical ¶
func ChecksumPhysical ¶
func ChecksumQualifiedPhysical ¶
Types ¶
type BareInode ¶
type Device ¶
type Device struct { diskio.File[btrfsvol.PhysicalAddr] // contains filtered or unexported fields }
func (*Device) Superblock ¶
func (dev *Device) Superblock() (*btrfstree.Superblock, error)
func (*Device) Superblocks ¶
func (dev *Device) Superblocks() ([]*diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock], error)
type Dir ¶
type FS ¶
type FS struct { // You should probably not access .LV directly, except when // implementing special things like fsck. LV btrfsvol.LogicalVolume[*Device] // contains filtered or unexported fields }
func (*FS) AcquireNode ¶
func (fs *FS) AcquireNode(ctx context.Context, addr btrfsvol.LogicalAddr, exp btrfstree.NodeExpectations) (*btrfstree.Node, error)
AcquireNode implements btrfstree.NodeSource.
func (*FS) ForrestLookup ¶
ForrestLookup implements btree.Forrest.
func (*FS) RawTree ¶
RawTree is a variant of ForrestLookup that returns a concrete type instead of an interface.
func (*FS) ReleaseNode ¶
ReleaseNode implements btrfstree.NodeSource.
func (*FS) Size ¶
func (fs *FS) Size() btrfsvol.LogicalAddr
func (*FS) Superblock ¶
func (fs *FS) Superblock() (*btrfstree.Superblock, error)
func (*FS) Superblocks ¶
func (fs *FS) Superblocks() ([]*diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock], error)
type File ¶
type File struct { FullInode Extents []FileExtent SV *Subvolume }
type FileExtent ¶
type FileExtent struct { OffsetWithinFile int64 btrfsitem.FileExtent }
type FullInode ¶
type ReadableFS ¶
type ReadableFS interface { Name() string // For reading btrees. btrfstree.Forrest // For reading the superblock and raw nodes. btrfstree.NodeSource // For reading file contents. diskio.ReaderAt[btrfsvol.LogicalAddr] }
Directories ¶
Path | Synopsis |
---|---|
Package btrfsitem contains the definitions of all "items" that may be stored in a btrfs tree.
|
Package btrfsitem contains the definitions of all "items" that may be stored in a btrfs tree. |
Package btrfsprim contains primitive btrfs datatypes, that all other btrfs sub-packages may make use of.
|
Package btrfsprim contains primitive btrfs datatypes, that all other btrfs sub-packages may make use of. |
Package btrfssum contains the checksum types and algorithms that btrfs uses.
|
Package btrfssum contains the checksum types and algorithms that btrfs uses. |
Package btrfstree contains core b+-tree implementation and interfaces.
|
Package btrfstree contains core b+-tree implementation and interfaces. |
Package btrfsvol contains core logical-volume-management layer of btrfs.
|
Package btrfsvol contains core logical-volume-management layer of btrfs. |
Click to show internal directories.
Click to hide internal directories.