Documentation
¶
Index ¶
- type Ext4Fs
- func (e *Ext4Fs) CalcAddExAttrSize(fileName string, attr string, data []byte, flags int) error
- func (e *Ext4Fs) CalcBlockDeviceSize(devName string, major uint64, minor uint64) error
- func (e *Ext4Fs) CalcCharDeviceSize(devName string, major uint64, minor uint64) error
- func (e *Ext4Fs) CalcDirSize(dirName string) error
- func (e *Ext4Fs) CalcFIFOPipeSize(pipeName string) error
- func (e *Ext4Fs) CalcHardlinkSize(srcName string, dstName string) error
- func (e *Ext4Fs) CalcRegFileSize(fileName string, fileSize uint64) error
- func (e *Ext4Fs) CalcSocketSize(sockName string) error
- func (e *Ext4Fs) CalcSymlinkSize(srcName string, dstName string) error
- func (e *Ext4Fs) CleanupSizeContext() error
- func (e *Ext4Fs) FinalizeSizeContext() error
- func (e *Ext4Fs) GetSizeInfo() FilesystemSizeInfo
- func (e *Ext4Fs) InitSizeContext() error
- func (e *Ext4Fs) MakeBasicFileSystem(file *os.File) error
- func (e *Ext4Fs) MakeFileSystem(file *os.File) error
- type Filesystem
- type FilesystemSizeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ext4Fs ¶
Ext4Fs implements the Filesystem interface for ext4.
Ext4Fs makes the following assumptions about the ext4 file system.
- No journal or GDT table
- Extent tree (instead of direct/indirect block addressing)
- Hash tree directories (instead of linear directories)
- Inline symlinks if < 60 chars, but no inline directories or reg files
- sparse_super ext4 flags, so superblocks backups are in powers of 3, 5, 7
- Directory entries take 1 block (even though its not true)
- All regular files/symlinks <= 128MB
func (*Ext4Fs) CalcAddExAttrSize ¶
func (*Ext4Fs) CalcBlockDeviceSize ¶
func (*Ext4Fs) CalcCharDeviceSize ¶
func (*Ext4Fs) CalcDirSize ¶
func (*Ext4Fs) CalcFIFOPipeSize ¶
func (*Ext4Fs) CalcHardlinkSize ¶
func (*Ext4Fs) CalcRegFileSize ¶
func (*Ext4Fs) CalcSocketSize ¶
func (*Ext4Fs) CalcSymlinkSize ¶
func (*Ext4Fs) CleanupSizeContext ¶
func (*Ext4Fs) FinalizeSizeContext ¶
func (*Ext4Fs) GetSizeInfo ¶
func (e *Ext4Fs) GetSizeInfo() FilesystemSizeInfo
func (*Ext4Fs) InitSizeContext ¶
InitSizeContext creates the context for a new ext4 filesystem context Before calling set e.BlockSize and e.InodeSize to the desired values.
type Filesystem ¶
type Filesystem interface { // InitContext() starts a new context to calculate the file system size. InitSizeContext() error // These functions calculate the size of different Linux file types after // the context has been created. CalcRegFileSize(fileName string, fileSize uint64) error CalcDirSize(dirName string) error CalcSymlinkSize(srcName string, dstName string) error CalcHardlinkSize(srcName string, dstName string) error CalcCharDeviceSize(devName string, major uint64, minor uint64) error CalcBlockDeviceSize(devName string, major uint64, minor uint64) error CalcFIFOPipeSize(pipeName string) error CalcSocketSize(sockName string) error CalcAddExAttrSize(fileName string, attr string, data []byte, flags int) error // FinalizeContext() finalizes the total size and inodes for the filesystem // in the current context. FinalizeSizeContext() error // GetSizeInfo() can be called before FinalizeContext() to get a intermediate result // or after to get the final result. GetSizeInfo() FilesystemSizeInfo // MakeFileSystem takes the current context and creates a file system on the // given device. MakeBasicFileSystem just makes the file system with default // arguments & does not a need a context. MakeFileSystem(file *os.File) error MakeBasicFileSystem(file *os.File) error // CleanupContext() clears up system resources to safely begin a new context CleanupSizeContext() error }
Filesystem is an interface that calculates the disk space a filesystem would take up and offers the option to create a file system disk image.
type FilesystemSizeInfo ¶
FilesystemSizeInfo contains the number of inodes and the total size.
Click to show internal directories.
Click to hide internal directories.