nsfs

package
v0.0.0-...-e4c45ee Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Overview

Package nsfs provides the filesystem implementation backing Kernel.NsfsMount.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilesystem

func NewFilesystem(vfsObj *vfs.VirtualFilesystem) (*vfs.Filesystem, error)

NewFilesystem sets up and returns a new vfs.Filesystem implemented by nsfs.

Types

type Inode

type Inode struct {
	kernfs.InodeAttrs
	kernfs.InodeAnonymous
	kernfs.InodeNotDirectory
	kernfs.InodeNotSymlink
	kernfs.InodeWatches
	// contains filtered or unexported fields
}

Inode implements kernfs.Inode.

+stateify savable

func NewInode

func NewInode(ctx context.Context, mnt *vfs.Mount, namespace vfs.Namespace) *Inode

NewInode creates a new nsfs inode.

func (*Inode) DecRef

func (i *Inode) DecRef(ctx context.Context)

DecRef implements kernfs.Inode.DecRef.

func (*Inode) IncRef

func (r *Inode) IncRef()

IncRef implements refs.RefCounter.IncRef.

func (*Inode) InitRefs

func (r *Inode) InitRefs()

InitRefs initializes r with one reference and, if enabled, activates leak checking.

func (*Inode) Keep

func (i *Inode) Keep() bool

Keep implements kernfs.Inode.Keep.

func (*Inode) LeakMessage

func (r *Inode) LeakMessage() string

LeakMessage implements refs.CheckedObject.LeakMessage.

func (*Inode) LogRefs

func (r *Inode) LogRefs() bool

LogRefs implements refs.CheckedObject.LogRefs.

func (*Inode) Mode

func (i *Inode) Mode() linux.FileMode

Mode implements kernfs.Inode.Mode.

func (*Inode) Name

func (i *Inode) Name() string

Name returns the inode name that is used to implement readlink() of /proc/pid/ns/ files.

func (*Inode) Namespace

func (i *Inode) Namespace() vfs.Namespace

Namespace returns the namespace associated with the inode.

func (*Inode) Open

Open implements kernfs.Inode.Open.

func (*Inode) ReadRefs

func (r *Inode) ReadRefs() int64

ReadRefs returns the current number of references. The returned count is inherently racy and is unsafe to use without external synchronization.

func (*Inode) RefType

func (r *Inode) RefType() string

RefType implements refs.CheckedObject.RefType.

func (*Inode) SetStat

func (i *Inode) SetStat(ctx context.Context, vfsfs *vfs.Filesystem, creds *auth.Credentials, opts vfs.SetStatOptions) error

SetStat implements kernfs.Inode.SetStat.

Linux sets S_IMMUTABLE to nsfs inodes that prevents any attribute changes on them.

func (*Inode) StatFS

func (i *Inode) StatFS(ctx context.Context, fs *vfs.Filesystem) (linux.Statfs, error)

StatFS implements kernfs.Inode.StatFS.

func (*Inode) StateFields

func (i *Inode) StateFields() []string

func (*Inode) StateLoad

func (i *Inode) StateLoad(stateSourceObject state.Source)

+checklocksignore

func (*Inode) StateSave

func (i *Inode) StateSave(stateSinkObject state.Sink)

+checklocksignore

func (*Inode) StateTypeName

func (i *Inode) StateTypeName() string

func (*Inode) TryIncRef

func (r *Inode) TryIncRef() bool

TryIncRef implements refs.TryRefCounter.TryIncRef.

To do this safely without a loop, a speculative reference is first acquired on the object. This allows multiple concurrent TryIncRef calls to distinguish other TryIncRef calls from genuine references held.

func (*Inode) VirtualDentry

func (i *Inode) VirtualDentry() vfs.VirtualDentry

VirtualDentry returns VirtualDentry for the inode.

Jump to

Keyboard shortcuts

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