Documentation ¶
Overview ¶
Package tmpfs is a filesystem implementation backed by memory.
Index ¶
- Constants
- func AddSeals(inode *fs.Inode, val uint32) error
- func GetSeals(inode *fs.Inode) (uint32, error)
- func NewDir(ctx context.Context, contents map[string]*fs.Inode, owner fs.FileOwner, ...) (*fs.Inode, error)
- func NewFifo(ctx context.Context, owner fs.FileOwner, perms fs.FilePermissions, ...) *fs.Inode
- func NewInMemoryFile(ctx context.Context, usage usage.MemoryKind, uattr fs.UnstableAttr) fs.InodeOperations
- func NewMemfdInode(ctx context.Context, allowSeals bool) *fs.Inode
- func NewSocket(ctx context.Context, socket transport.BoundEndpoint, owner fs.FileOwner, ...) *fs.Inode
- func NewSymlink(ctx context.Context, target string, owner fs.FileOwner, msrc *fs.MountSource) *fs.Inode
- type Dir
- func (d *Dir) AddLink()
- func (d *Dir) Allocate(ctx context.Context, node *fs.Inode, offset, length int64) error
- func (d *Dir) Bind(ctx context.Context, dir *fs.Inode, name string, ep transport.BoundEndpoint, ...) (*fs.Dirent, error)
- func (d *Dir) Create(ctx context.Context, dir *fs.Inode, name string, flags fs.FileFlags, ...) (*fs.File, error)
- func (d *Dir) CreateDirectory(ctx context.Context, dir *fs.Inode, name string, perms fs.FilePermissions) error
- func (d *Dir) CreateFifo(ctx context.Context, dir *fs.Inode, name string, perms fs.FilePermissions) error
- func (d *Dir) CreateHardLink(ctx context.Context, dir *fs.Inode, target *fs.Inode, name string) error
- func (d *Dir) CreateLink(ctx context.Context, dir *fs.Inode, oldname, newname string) error
- func (d *Dir) DropLink()
- func (d *Dir) GetFile(ctx context.Context, dirent *fs.Dirent, flags fs.FileFlags) (*fs.File, error)
- func (d *Dir) GetXattr(ctx context.Context, i *fs.Inode, name string, size uint64) (string, error)
- func (d *Dir) ListXattr(ctx context.Context, i *fs.Inode, size uint64) (map[string]struct{}, error)
- func (d *Dir) Lookup(ctx context.Context, i *fs.Inode, p string) (*fs.Dirent, error)
- func (d *Dir) NotifyStatusChange(ctx context.Context)
- func (d *Dir) Release(ctx context.Context)
- func (d *Dir) Remove(ctx context.Context, i *fs.Inode, name string) error
- func (d *Dir) RemoveDirectory(ctx context.Context, i *fs.Inode, name string) error
- func (d *Dir) RemoveXattr(ctx context.Context, i *fs.Inode, name string) error
- func (d *Dir) Rename(ctx context.Context, inode *fs.Inode, oldParent *fs.Inode, oldName string, ...) error
- func (d *Dir) SetOwner(ctx context.Context, i *fs.Inode, owner fs.FileOwner) error
- func (d *Dir) SetPermissions(ctx context.Context, i *fs.Inode, p fs.FilePermissions) bool
- func (d *Dir) SetTimestamps(ctx context.Context, i *fs.Inode, ts fs.TimeSpec) error
- func (d *Dir) SetXattr(ctx context.Context, i *fs.Inode, name, value string, flags uint32) error
- func (*Dir) StatFS(context.Context) (fs.Info, error)
- func (d *Dir) UnstableAttr(ctx context.Context, i *fs.Inode) (fs.UnstableAttr, error)
- type Fifo
- type Filesystem
- type Socket
- type Symlink
Constants ¶
const FilesystemName = "tmpfs"
FilesystemName is the name under which the filesystem is registered. Name matches mm/shmem.c:shmem_fs_type.name.
Variables ¶
This section is empty.
Functions ¶
func NewDir ¶
func NewDir(ctx context.Context, contents map[string]*fs.Inode, owner fs.FileOwner, perms fs.FilePermissions, msrc *fs.MountSource, parent *fs.Inode) (*fs.Inode, error)
NewDir returns a new directory.
func NewFifo ¶
func NewFifo(ctx context.Context, owner fs.FileOwner, perms fs.FilePermissions, msrc *fs.MountSource) *fs.Inode
NewFifo creates a new named pipe.
func NewInMemoryFile ¶
func NewInMemoryFile(ctx context.Context, usage usage.MemoryKind, uattr fs.UnstableAttr) fs.InodeOperations
NewInMemoryFile returns a new file backed by Kernel.MemoryFile().
func NewMemfdInode ¶
NewMemfdInode creates a new inode backing a memfd. Memory used by the memfd is backed by platform memory.
func NewSocket ¶
func NewSocket(ctx context.Context, socket transport.BoundEndpoint, owner fs.FileOwner, perms fs.FilePermissions, msrc *fs.MountSource) *fs.Inode
NewSocket returns a new socket with the provided permissions.
Types ¶
type Dir ¶
type Dir struct { fsutil.InodeGenericChecker `state:"nosave"` fsutil.InodeIsDirTruncate `state:"nosave"` fsutil.InodeNoopWriteOut `state:"nosave"` fsutil.InodeNotMappable `state:"nosave"` fsutil.InodeNotSocket `state:"nosave"` fsutil.InodeNotSymlink `state:"nosave"` fsutil.InodeVirtual `state:"nosave"` // contains filtered or unexported fields }
Dir is a directory.
+stateify savable
func (*Dir) Bind ¶
func (d *Dir) Bind(ctx context.Context, dir *fs.Inode, name string, ep transport.BoundEndpoint, perms fs.FilePermissions) (*fs.Dirent, error)
Bind implements fs.InodeOperations.Bind.
func (*Dir) Create ¶
func (d *Dir) Create(ctx context.Context, dir *fs.Inode, name string, flags fs.FileFlags, perms fs.FilePermissions) (*fs.File, error)
Create implements fs.InodeOperations.Create.
func (*Dir) CreateDirectory ¶
func (d *Dir) CreateDirectory(ctx context.Context, dir *fs.Inode, name string, perms fs.FilePermissions) error
CreateDirectory implements fs.InodeOperations.CreateDirectory.
func (*Dir) CreateFifo ¶
func (d *Dir) CreateFifo(ctx context.Context, dir *fs.Inode, name string, perms fs.FilePermissions) error
CreateFifo implements fs.InodeOperations.CreateFifo.
func (*Dir) CreateHardLink ¶
func (d *Dir) CreateHardLink(ctx context.Context, dir *fs.Inode, target *fs.Inode, name string) error
CreateHardLink implements fs.InodeOperations.CreateHardLink.
func (*Dir) CreateLink ¶
CreateLink implements fs.InodeOperations.CreateLink.
func (*Dir) NotifyStatusChange ¶
NotifyStatusChange implements fs.InodeOperations.NotifyStatusChange.
func (*Dir) RemoveDirectory ¶
RemoveDirectory implements fs.InodeOperations.RemoveDirectory.
func (*Dir) RemoveXattr ¶
RemoveXattr implements fs.InodeOperations.RemoveXattr.
func (*Dir) Rename ¶
func (d *Dir) Rename(ctx context.Context, inode *fs.Inode, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string, replacement bool) error
Rename implements fs.InodeOperations.Rename.
func (*Dir) SetPermissions ¶
SetPermissions implements fs.InodeOperations.SetPermissions.
func (*Dir) SetTimestamps ¶
SetTimestamps implements fs.InodeOperations.SetTimestamps.
func (*Dir) UnstableAttr ¶
UnstableAttr implements fs.InodeOperations.UnstableAttr.
type Fifo ¶
type Fifo struct {
fs.InodeOperations
}
Fifo is a tmpfs named pipe.
+stateify savable
type Filesystem ¶
type Filesystem struct{}
Filesystem is a tmpfs.
+stateify savable
func (*Filesystem) AllowUserList ¶
func (*Filesystem) AllowUserList() bool
AllowUserList allows this filesystem to be listed in /proc/filesystems.
func (*Filesystem) AllowUserMount ¶
func (*Filesystem) AllowUserMount() bool
AllowUserMount allows users to mount(2) this file system.
func (*Filesystem) Flags ¶
func (*Filesystem) Flags() fs.FilesystemFlags
Flags returns that there is nothing special about this file system.
In Linux, tmpfs returns FS_USERNS_MOUNT, see mm/shmem.c.
type Socket ¶
type Socket struct { ramfs.Socket fsutil.InodeNotTruncatable `state:"nosave"` fsutil.InodeNotAllocatable `state:"nosave"` }
Socket is a socket.
+stateify savable