fs

package
v0.0.0-...-ffd3a61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RootInode = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Filesystem

type Filesystem struct {
	// contains filtered or unexported fields
}

func NewEmptyFilesystem

func NewEmptyFilesystem() *Filesystem

func NewLinuxFilesystem

func NewLinuxFilesystem() *Filesystem

func (*Filesystem) CloseFile

func (fs *Filesystem) CloseFile(inode int) error

func (*Filesystem) CrashClone

func (fs *Filesystem) CrashClone(partialDisk bool) *Filesystem

func (*Filesystem) FlushEverything

func (fs *Filesystem) FlushEverything()

func (*Filesystem) GetInodeInfo

func (fs *Filesystem) GetInodeInfo(inode int) InodeInfo

func (*Filesystem) Getdirinode

func (fs *Filesystem) Getdirinode(dirInode int, path string) (int, error)

func (*Filesystem) Getpath

func (fs *Filesystem) Getpath(dirInode int) (string, error)

for getcwd

func (*Filesystem) IterCrashes

func (fs *Filesystem) IterCrashes() func() (*Filesystem, bool)

func (*Filesystem) Mkdir

func (fs *Filesystem) Mkdir(dirInode int, path string) error

func (*Filesystem) Mmap

func (fs *Filesystem) Mmap(inode int, len int) *Mmap

Open a mmap for the given inode. Mmap starts at offset 0.

func (*Filesystem) Munmap

func (fs *Filesystem) Munmap(m *Mmap)

Close the given mmap.

func (*Filesystem) OpenFile

func (fs *Filesystem) OpenFile(dirInode int, path string, flag int) (int, error)

func (*Filesystem) Read

func (fs *Filesystem) Read(inode int, pos int64, buffer syscallabi.ByteSliceView) int

func (*Filesystem) ReadDir

func (fs *Filesystem) ReadDir(inode int) ([]ReadDirEntry, error)

func (*Filesystem) Release

func (fs *Filesystem) Release()

func (*Filesystem) Remove

func (fs *Filesystem) Remove(dirInode int, path string, rmDir bool) error

func (*Filesystem) Rename

func (fs *Filesystem) Rename(fromInode int, fromPath string, toInode int, toPath string) error

func (*Filesystem) Stat

func (fs *Filesystem) Stat(dirInode int, path string) (StatResp, error)

func (*Filesystem) Statfd

func (fs *Filesystem) Statfd(inode int) (StatResp, error)

func (*Filesystem) Sync

func (fs *Filesystem) Sync(inode int)

func (*Filesystem) Truncate

func (fs *Filesystem) Truncate(inode, pos int)

func (*Filesystem) Write

func (fs *Filesystem) Write(inode int, pos int64, buffer syscallabi.ByteSliceView) int

type InodeInfo

type InodeInfo struct {
	MemLinks   int
	MemExists  bool
	DiskLinks  int
	DiskExists bool
	Handles    int
	Ops        int
}

type Mmap

type Mmap struct {
	Inode int
	Data  syscallabi.ByteSliceView
}

A Mmap tracks an open mmap for a given file. Mmaps are implemented by keeping a slice around with the contents of the file.

Only read-only mmaps are supported since we do not get notified on writes. That is enough to make go.etcd.io/bbolt work.

type ReadDirEntry

type ReadDirEntry struct {
	Name  string
	IsDir bool
}

type StatResp

type StatResp struct {
	Inode int
	IsDir bool
	Size  int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL