Documentation ¶
Overview ¶
Package nsfs provides the filesystem implementation backing Kernel.NsfsMount.
Index ¶
- func NewFilesystem(vfsObj *vfs.VirtualFilesystem) (*vfs.Filesystem, error)
- type Inode
- func (i *Inode) DecRef(ctx context.Context)
- func (r *Inode) IncRef()
- func (r *Inode) InitRefs()
- func (i *Inode) Keep() bool
- func (r *Inode) LeakMessage() string
- func (r *Inode) LogRefs() bool
- func (i *Inode) Mode() linux.FileMode
- func (i *Inode) Name() string
- func (i *Inode) Namespace() vfs.Namespace
- func (i *Inode) Open(ctx context.Context, rp *vfs.ResolvingPath, d *kernfs.Dentry, ...) (*vfs.FileDescription, error)
- func (r *Inode) ReadRefs() int64
- func (r *Inode) RefType() string
- func (i *Inode) SetStat(ctx context.Context, vfsfs *vfs.Filesystem, creds *auth.Credentials, ...) error
- func (i *Inode) StatFS(ctx context.Context, fs *vfs.Filesystem) (linux.Statfs, error)
- func (i *Inode) StateFields() []string
- func (i *Inode) StateLoad(stateSourceObject state.Source)
- func (i *Inode) StateSave(stateSinkObject state.Sink)
- func (i *Inode) StateTypeName() string
- func (r *Inode) TryIncRef() bool
- func (i *Inode) VirtualDentry() vfs.VirtualDentry
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 (*Inode) InitRefs ¶
func (r *Inode) InitRefs()
InitRefs initializes r with one reference and, if enabled, activates leak checking.
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) Name ¶
Name returns the inode name that is used to implement readlink() of /proc/pid/ns/ files.
func (*Inode) Open ¶
func (i *Inode) Open(ctx context.Context, rp *vfs.ResolvingPath, d *kernfs.Dentry, opts vfs.OpenOptions) (*vfs.FileDescription, error)
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) StateFields ¶
func (*Inode) StateTypeName ¶
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.