tmpfs

package
v0.0.0-...-23e6066 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package tmpfs is a filesystem implementation backed by memory.

Index

Constants

View Source
const FilesystemName = "tmpfs"

FilesystemName is the name underwhich 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, platform platform.Platform) *fs.Inode

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, p platform.Platform) fs.InodeOperations

NewInMemoryFile returns a new file backed by p.Memory().

func NewSocket

func NewSocket(ctx context.Context, socket unix.BoundEndpoint, owner fs.FileOwner, perms fs.FilePermissions, msrc *fs.MountSource) *fs.Inode

NewSocket returns a new socket with the provided permissions.

func NewSymlink(ctx context.Context, target string, owner fs.FileOwner, msrc *fs.MountSource) *fs.Inode

NewSymlink returns a new symlink with the provided permissions.

Types

type Dir

type Dir struct {
	ramfs.Dir
	// contains filtered or unexported fields
}

Dir is a directory.

func (*Dir) Rename

func (d *Dir) Rename(ctx context.Context, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string) error

Rename implements fs.InodeOperations.Rename.

func (*Dir) StatFS

func (*Dir) StatFS(context.Context) (fs.Info, error)

StatFS implments fs.InodeOperations.StatFS.

type Fifo

type Fifo struct {
	ramfs.Entry
}

Fifo is a tmpfs named pipe.

func (*Fifo) Rename

func (f *Fifo) Rename(ctx context.Context, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string) error

Rename implements fs.InodeOperations.Rename.

func (*Fifo) StatFS

func (*Fifo) StatFS(context.Context) (fs.Info, error)

StatFS returns the tmpfs info.

type Filesystem

type Filesystem struct{}

Filesystem is a tmpfs.

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.

func (*Filesystem) Mount

func (f *Filesystem) Mount(ctx context.Context, device string, flags fs.MountSourceFlags, data string) (*fs.Inode, error)

Mount returns a tmpfs root that can be positioned in the vfs.

func (*Filesystem) Name

func (*Filesystem) Name() string

Name is the name of the file system.

type Socket

type Socket struct {
	ramfs.Socket
}

Socket is a socket.

func (*Socket) Rename

func (s *Socket) Rename(ctx context.Context, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string) error

Rename implements fs.InodeOperations.Rename.

func (*Socket) StatFS

func (s *Socket) StatFS(context.Context) (fs.Info, error)

StatFS returns the tmpfs info.

type Symlink struct {
	ramfs.Symlink
}

Symlink is a symlink.

func (*Symlink) Rename

func (s *Symlink) Rename(ctx context.Context, oldParent *fs.Inode, oldName string, newParent *fs.Inode, newName string) error

Rename implements fs.InodeOperations.Rename.

func (*Symlink) StatFS

func (s *Symlink) StatFS(context.Context) (fs.Info, error)

StatFS returns the tmpfs info.

Jump to

Keyboard shortcuts

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