mount

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(source string, mountpoint string, fstype *string, options *string) error

func MountFn added in v0.4.3

func MountFn(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (<-chan error, func() error, error)

func UmountByDevice

func UmountByDevice(device string) error

func UmountByMountPoint

func UmountByMountPoint(mountpoint string) error

Types

type Dir added in v0.4.3

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

Dir represents a directory entry

func (*Dir) Attr added in v0.4.3

func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) (err error)

Attr updates the attributes of a directory

func (*Dir) Create added in v0.4.3

func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (node fusefs.Node, handle fusefs.Handle, err error)

Create makes a new file

func (*Dir) Fsync added in v0.4.3

func (d *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error)

Fsync the directory

func (d *Dir) Link(ctx context.Context, req *fuse.LinkRequest, old fusefs.Node) (newNode fusefs.Node, err error)

Link creates a new directory entry in the receiver based on an existing Node. Receiver must be a directory.

func (*Dir) Lookup added in v0.4.3

func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (node fusefs.Node, err error)

Lookup looks up a specific entry in the receiver.

Lookup should return a Node corresponding to the entry. If the name does not exist in the directory, Lookup should return ENOENT.

Lookup need not to handle the names "." and "..".

func (*Dir) Mkdir added in v0.4.3

func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (node fusefs.Node, err error)

Mkdir creates a new directory

func (*Dir) Mknod added in v0.4.3

func (d *Dir) Mknod(ctx context.Context, req *fuse.MknodRequest) (node fusefs.Node, err error)

Mknod is called to create a file. Since we define create this will be called in preference, however NFS likes to call it for some reason. We don't actually create a file here just the Node.

func (*Dir) ReadDirAll added in v0.4.3

func (d *Dir) ReadDirAll(ctx context.Context) (dirents []fuse.Dirent, err error)

ReadDirAll reads the contents of the directory

func (*Dir) Remove added in v0.4.3

func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error)

Remove removes the entry with the given name from the receiver, which must be a directory. The entry to be removed may correspond to a file (unlink) or to a directory (rmdir).

func (*Dir) Rename added in v0.4.3

func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDir fusefs.Node) (err error)

Rename the file

func (*Dir) Setattr added in v0.4.3

func (d *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error)

Setattr handles attribute changes from FUSE. Currently supports ModTime only.

type FS added in v0.4.3

type FS struct {
	*vfs.VFS
	// contains filtered or unexported fields
}

func NewFS added in v0.4.3

func NewFS(VFS *vfs.VFS, opt *mountlib.Options) *FS

func (*FS) Root added in v0.4.3

func (f *FS) Root() (node fusefs.Node, err error)

Root returns the root node

type File added in v0.4.3

type File struct {
	*vfs.File
	// contains filtered or unexported fields
}

File represents a file

func (*File) Attr added in v0.4.3

func (f *File) Attr(ctx context.Context, a *fuse.Attr) (err error)

Attr fills out the attributes for the file

func (*File) Fsync added in v0.4.3

func (f *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error)

Fsync the file

Note that we don't do anything except return OK

func (*File) Getxattr added in v0.4.3

func (f *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp *fuse.GetxattrResponse) error

Getxattr gets an extended attribute by the given name from the node.

If there is no xattr by that name, returns fuse.ErrNoXattr.

func (*File) Listxattr added in v0.4.3

func (f *File) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error

Listxattr lists the extended attributes recorded for the node.

func (*File) Open added in v0.4.3

func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fh fusefs.Handle, err error)

Open the file for read or write

func (*File) Removexattr added in v0.4.3

func (f *File) Removexattr(ctx context.Context, req *fuse.RemovexattrRequest) error

Removexattr removes an extended attribute for the name.

If there is no xattr by that name, returns fuse.ErrNoXattr.

func (*File) Setattr added in v0.4.3

func (f *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error)

Setattr handles attribute changes from FUSE. Currently supports ModTime and Size only

func (*File) Setxattr added in v0.4.3

func (f *File) Setxattr(ctx context.Context, req *fuse.SetxattrRequest) error

Setxattr sets an extended attribute with the given name and value for the node.

type FileHandle added in v0.4.3

type FileHandle struct {
	vfs.Handle
}

FileHandle is an open for read file handle on a File

func (*FileHandle) Flush added in v0.4.3

func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) (err error)

Flush is called on each close() of a file descriptor. So if a filesystem wants to return write errors in close() and the file has cached dirty data, this is a good place to write back data and return any errors. Since many applications ignore close() errors this is not always useful.

NOTE: The flush() method may be called more than once for each open(). This happens if more than one file descriptor refers to an opened file due to dup(), dup2() or fork() calls. It is not possible to determine if a flush is final, so each flush should be treated equally. Multiple write-flush sequences are relatively rare, so this shouldn't be a problem.

Filesystems shouldn't assume that flush will always be called after some writes, or that if will be called at all.

func (*FileHandle) Read added in v0.4.3

func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) (err error)

Read from the file handle

func (*FileHandle) Release added in v0.4.3

func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error)

Release is called when we are finished with the file handle

It isn't called directly from userspace so the error is ignored by the kernel

func (*FileHandle) Write added in v0.4.3

func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) (err error)

Write data to the file handle

Jump to

Keyboard shortcuts

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