irodsfs

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FSName  string = "irodsfs"
	Subtype string = "irodsfs"
)

Variables

This section is empty.

Functions

func DummyDirGetattr added in v0.9.0

func DummyDirGetattr(ctx context.Context, fs *IRODSFS, path string, vpathReadonly bool, out *fuse.AttrOut) syscall.Errno

DummyDirGetattr returns an attr for the given irods path

func GetFuseOptions added in v0.7.9

func GetFuseOptions(config *commons.Config) *fusefs.Options

GetFuseOptions returns fuse options

func IRODSGetACL added in v0.9.0

func IRODSGetACL(ctx context.Context, fs *IRODSFS, entry *irodsclient_fs.Entry, readonly bool) os.FileMode

IRODSGetACL returns ACL flag from iRODS entry

func IRODSGetOpenFlags added in v0.9.0

func IRODSGetOpenFlags(flags uint32) irodsclient_types.FileOpenMode

IRODSGetOpenFlags converts file open flags to iRODS file open mode

func IRODSGetPermission added in v0.9.0

func IRODSGetPermission(level irodsclient_types.IRODSAccessLevelType) os.FileMode

IRODSGetACL returns permission flag from iRODS access level type

func IRODSGetattr added in v0.9.0

func IRODSGetattr(ctx context.Context, fs *IRODSFS, path string, vpathReadonly bool, out *fuse.AttrOut) syscall.Errno

IRODSGetattr returns an attr for the given irods path

func IRODSGetxattr added in v0.9.0

func IRODSGetxattr(ctx context.Context, fs *IRODSFS, path string, attr string, dest []byte) (uint32, syscall.Errno)

IRODSGetxattr returns an xattr for the given irods path and attr name

func IRODSListxattr added in v0.9.0

func IRODSListxattr(ctx context.Context, fs *IRODSFS, path string, dest []byte) (uint32, syscall.Errno)

IRODSListxattr returns all xattrs for the given irods path

func IRODSLookup added in v0.9.0

func IRODSLookup(ctx context.Context, fs *IRODSFS, dir *Dir, path string, vpathReadonly bool, out *fuse.EntryOut) (int64, bool, syscall.Errno)

IRODSLookup returns entry for the given irods path

func IRODSMkdir added in v0.9.0

func IRODSMkdir(ctx context.Context, fs *IRODSFS, dir *Dir, path string, out *fuse.EntryOut) (int64, syscall.Errno)

IRODSMkdir removes dir for the given irods path

func IRODSOpendir added in v0.9.0

func IRODSOpendir(ctx context.Context, fs *IRODSFS, path string) syscall.Errno

IRODSOpendir opens dir for the given irods path

func IRODSReaddir added in v0.9.0

func IRODSReaddir(ctx context.Context, fs *IRODSFS, path string) ([]fuse.DirEntry, syscall.Errno)

IRODSReaddir reads dir entries for the given irods path

func IRODSRemovexattr added in v0.9.0

func IRODSRemovexattr(ctx context.Context, fs *IRODSFS, path string, attr string) syscall.Errno

IRODSRemovexattr unsets an xattr for the given irods path and attr name

func IRODSRename added in v0.9.0

func IRODSRename(ctx context.Context, fs *IRODSFS, dir *Dir, srcPath string, destPath string) syscall.Errno

IRODSRename renames file or dir for the given irods path

func IRODSRmdir added in v0.9.0

func IRODSRmdir(ctx context.Context, fs *IRODSFS, path string) syscall.Errno

IRODSRmdir removes dir for the given irods path

func IRODSSetxattr added in v0.9.0

func IRODSSetxattr(ctx context.Context, fs *IRODSFS, path string, attr string, data []byte) syscall.Errno

IRODSSetxattr sets an xattr for the given irods path and attr name

func IRODSStat added in v0.9.0

func IRODSStat(ctx context.Context, fs *IRODSFS, path string) (*irodsclient_fs.Entry, error)

IRODSStat returns a stat for the given irods path

func IRODSUnlink(ctx context.Context, fs *IRODSFS, path string) syscall.Errno

IRODSUnlink removes file for the given irods path

func IsUnhandledAttr added in v0.8.0

func IsUnhandledAttr(attr string) bool

IsUnhandledAttr checks if given attr is ignored

Types

type Dir

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

Dir is a directory node

func NewDir

func NewDir(fs *IRODSFS, inodeID uint64, path string) *Dir

NewDir creates a new Dir

func NewIRODSRoot added in v0.9.0

func NewIRODSRoot(fs *IRODSFS, vpathEntry *irodsfs_common_vpath.VPathEntry) (*Dir, error)

NewIRODSRoot returns root directory node for iRODS collection

func NewSubDirInode added in v0.9.0

func NewSubDirInode(ctx context.Context, dir *Dir, inodeID uint64, path string) (*Dir, *fusefs.Inode)

func (*Dir) Create

func (dir *Dir) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (*fusefs.Inode, fusefs.FileHandle, uint32, syscall.Errno)

Create creates a file for the path and returns file handle

func (*Dir) Fsync added in v0.8.16

func (dir *Dir) Fsync(ctx context.Context, fh fusefs.FileHandle, flags uint32) syscall.Errno

Fsync flushes content changes

func (*Dir) Getattr added in v0.7.9

func (dir *Dir) Getattr(ctx context.Context, fh fusefs.FileHandle, out *fuse.AttrOut) syscall.Errno

Getattr returns stat of file entry

func (*Dir) Getxattr added in v0.8.0

func (dir *Dir) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno)

Getxattr returns xattr return the number of bytes. If `dest` is too small, it should return ERANGE and the size of the attribute. If not defined, Getxattr will return ENOATTR.

func (*Dir) Listxattr added in v0.8.0

func (dir *Dir) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno)

Listxattr lists xattr read all attributes (null terminated) into `dest`. If the `dest` buffer is too small, it should return ERANGE and the correct size. If not defined, return an empty list and success.

func (*Dir) Lookup

func (dir *Dir) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)

Lookup returns a node for the path

func (*Dir) Mkdir

func (dir *Dir) Mkdir(ctx context.Context, name string, mode uint32, out *fuse.EntryOut) (*fusefs.Inode, syscall.Errno)

Mkdir makes a dir for the path

func (*Dir) Opendir added in v0.7.9

func (dir *Dir) Opendir(ctx context.Context) syscall.Errno

Opendir validates the existance of a dir

func (*Dir) Readdir added in v0.7.9

func (dir *Dir) Readdir(ctx context.Context) (fusefs.DirStream, syscall.Errno)

Readdir returns directory entries

func (*Dir) Removexattr added in v0.8.0

func (dir *Dir) Removexattr(ctx context.Context, attr string) syscall.Errno

Removexattr removes xattr If not defined, Removexattr will return ENOATTR.

func (*Dir) Rename

func (dir *Dir) Rename(ctx context.Context, name string, newParent fusefs.InodeEmbedder, newName string, flags uint32) syscall.Errno

Rename renames a node for the path

func (*Dir) Rmdir added in v0.7.9

func (dir *Dir) Rmdir(ctx context.Context, name string) syscall.Errno

Rmdir removes a dir

func (*Dir) Setattr added in v0.7.1

func (dir *Dir) Setattr(ctx context.Context, fh fusefs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno

Setattr sets dir attributes

func (*Dir) Setxattr added in v0.8.0

func (dir *Dir) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno

Setxattr sets xattr If not defined, Setxattr will return ENOATTR.

func (dir *Dir) Unlink(ctx context.Context, name string) syscall.Errno

Unlink removes a file for the path

type File

type File struct {
	fusefs.Inode
	// contains filtered or unexported fields
}

File is a file node

func NewFile

func NewFile(fs *IRODSFS, inodeID uint64, path string) *File

NewFile creates a new File

func NewSubFileInode added in v0.9.0

func NewSubFileInode(ctx context.Context, dir *Dir, inodeID uint64, path string) (*File, *fusefs.Inode)

func (*File) Getattr added in v0.7.9

func (file *File) Getattr(ctx context.Context, fh fusefs.FileHandle, out *fuse.AttrOut) syscall.Errno

Getattr returns stat of file entry

func (*File) Getlk added in v0.8.16

func (file *File) Getlk(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) syscall.Errno

Getlk returns locks

func (*File) Getxattr added in v0.8.0

func (file *File) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno)

Getxattr returns xattr return the number of bytes. If `dest` is too small, it should return ERANGE and the size of the attribute. If not defined, Getxattr will return ENOATTR.

func (*File) Listxattr added in v0.8.0

func (file *File) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno)

Listxattr lists xattr read all attributes (null terminated) into `dest`. If the `dest` buffer is too small, it should return ERANGE and the correct size. If not defined, return an empty list and success.

func (*File) Open

func (file *File) Open(ctx context.Context, flags uint32) (fusefs.FileHandle, uint32, syscall.Errno)

Open opens file for the path and returns file handle

func (*File) Removexattr added in v0.8.0

func (file *File) Removexattr(ctx context.Context, attr string) syscall.Errno

Removexattr removes xattr If not defined, Removexattr will return ENOATTR.

func (*File) Setattr

func (file *File) Setattr(ctx context.Context, fh fusefs.FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno

Setattr sets file attributes

func (*File) Setlk added in v0.8.16

func (file *File) Setlk(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno

Setlk obtains a lock on a file, or fail if the lock could not obtained

func (*File) Setlkw added in v0.8.16

func (file *File) Setlkw(ctx context.Context, fh fusefs.FileHandle, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno

Setlkw obtains a lock on a file, waiting if necessary

func (*File) Setxattr added in v0.8.0

func (file *File) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno

Setxattr sets xattr If not defined, Setxattr will return ENOATTR.

func (*File) Truncate

func (file *File) Truncate(ctx context.Context, size uint64) syscall.Errno

Truncate truncates file entry

type FileHandle

type FileHandle struct {
	// contains filtered or unexported fields
}

FileHandle is a file handle

func IRODSCreate added in v0.9.0

func IRODSCreate(ctx context.Context, fs *IRODSFS, dir *Dir, path string, flags uint32, out *fuse.EntryOut) (int64, *FileHandle, syscall.Errno)

IRODSCreate creates file for the given irods path

func IRODSOpen added in v0.9.0

func IRODSOpen(ctx context.Context, fs *IRODSFS, file *File, path string, flags uint32) (*FileHandle, syscall.Errno)

IRODSOpen opens file for the given irods path

func IRODSOpenLazy added in v0.9.4

func IRODSOpenLazy(ctx context.Context, fs *IRODSFS, file *File, path string, flags uint32) (*FileHandle, syscall.Errno)

IRODSOpenLazy opens file for the given irods path lazily when it first read or write

func NewFileHandle

func NewFileHandle(fs *IRODSFS, fileHandle irodsfscommon_irods.IRODSFSFileHandle) (*FileHandle, error)

func NewFileHandleLazy added in v0.9.4

func NewFileHandleLazy(fs *IRODSFS, path string, openMode irodsclient_types.FileOpenMode) (*FileHandle, error)

func (*FileHandle) Flush

func (handle *FileHandle) Flush(ctx context.Context) syscall.Errno

Flush flushes content changes

func (*FileHandle) Fsync added in v0.7.9

func (handle *FileHandle) Fsync(ctx context.Context, flags uint32) syscall.Errno

Fsync flushes content changes

func (*FileHandle) GetID added in v0.9.4

func (handle *FileHandle) GetID() string

GetID returns ID

func (*FileHandle) GetLocalLock added in v0.8.16

func (handle *FileHandle) GetLocalLock(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) syscall.Errno

GetLocalLock returns local lock

func (*FileHandle) GetPath added in v0.9.4

func (handle *FileHandle) GetPath() string

GetPath returns path

func (*FileHandle) Getattr added in v0.7.9

func (handle *FileHandle) Getattr(ctx context.Context, out *fuse.AttrOut) syscall.Errno

Getattr returns stat of file entry

func (*FileHandle) Getlk added in v0.8.16

func (handle *FileHandle) Getlk(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32, out *fuse.FileLock) syscall.Errno

Getlk returns lock

func (*FileHandle) Read

func (handle *FileHandle) Read(ctx context.Context, dest []byte, offset int64) (fuse.ReadResult, syscall.Errno)

Read reads file content

func (*FileHandle) Release

func (handle *FileHandle) Release(ctx context.Context) syscall.Errno

Release closes file handle

func (*FileHandle) SetFile added in v0.9.0

func (handle *FileHandle) SetFile(file *File)

SetFile sets File

func (*FileHandle) SetLocalLock added in v0.8.16

func (handle *FileHandle) SetLocalLock(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno

SetLocalLock sets local lock

func (*FileHandle) SetLocalLockW added in v0.8.16

func (handle *FileHandle) SetLocalLockW(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno

SetLocalLockW sets local lock and wait until it acquires the lock

func (*FileHandle) Setattr added in v0.7.9

func (handle *FileHandle) Setattr(ctx context.Context, in *fuse.SetAttrIn, out *fuse.AttrOut) syscall.Errno

Setattr sets file attributes

func (*FileHandle) Setlk added in v0.8.16

func (handle *FileHandle) Setlk(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno

Setlk locks the file handle

func (*FileHandle) Setlkw added in v0.8.16

func (handle *FileHandle) Setlkw(ctx context.Context, owner uint64, lk *fuse.FileLock, flags uint32) syscall.Errno

Setlkw locks the file handle and wait until it acquires the lock

func (*FileHandle) Truncate

func (handle *FileHandle) Truncate(ctx context.Context, size uint64) syscall.Errno

Truncate truncates file content

func (*FileHandle) Write

func (handle *FileHandle) Write(ctx context.Context, data []byte, offset int64) (uint32, syscall.Errno)

Write writes file content

type FileHandleLocalLock added in v0.8.16

type FileHandleLocalLock struct {
	ID       string
	LockType uint32 // syscall.F_RDLCK or syscall.F_WRLCK
	Pid      uint32
	Start    uint64
	End      uint64
}

FileHandleLocalLock is a struct for locally managed file lock

type FileHandleLocalLockManager added in v0.8.16

type FileHandleLocalLockManager struct {
	// contains filtered or unexported fields
}

FileHandleLocalLockManager is a manager that manages FileHandleLocalLocks

func NewFileHandleLocalLockManager added in v0.8.16

func NewFileHandleLocalLockManager() *FileHandleLocalLockManager

NewFileHandleLocalLockManager creates a new FileHandleLocalLockManager

func (*FileHandleLocalLockManager) Get added in v0.8.16

func (manager *FileHandleLocalLockManager) Get(start uint64, end uint64) *FileHandleLocalLock

Get returns lock

func (*FileHandleLocalLockManager) Lock added in v0.8.16

Lock locks, return error if it errors

func (*FileHandleLocalLockManager) Unlock added in v0.8.16

func (manager *FileHandleLocalLockManager) Unlock(lock *FileHandleLocalLock) error

Unlock unlocks

type FileHandleMap

type FileHandleMap struct {
	// contains filtered or unexported fields
}

func NewFileHandleMap

func NewFileHandleMap() *FileHandleMap

NewFileHandleMap creates a new FileHandleMap

func (*FileHandleMap) Add

func (fileHandleMap *FileHandleMap) Add(handle *FileHandle)

Add registers a file handle

func (*FileHandleMap) Clear

func (fileHandleMap *FileHandleMap) Clear()

Clear clears all file handles registered

func (*FileHandleMap) Get

func (fileHandleMap *FileHandleMap) Get(id string) *FileHandle

Get returns a file handle registered using ID

func (*FileHandleMap) List

func (fileHandleMap *FileHandleMap) List() []*FileHandle

List lists all file handles registered

func (*FileHandleMap) ListByPath

func (fileHandleMap *FileHandleMap) ListByPath(path string) []*FileHandle

ListByPath returns file handles registered using path

func (*FileHandleMap) ListPathsInDir

func (fileHandleMap *FileHandleMap) ListPathsInDir(parentPath string) []string

ListPathsUnderDir returns paths of file handles under given parent path

func (*FileHandleMap) Pop

func (fileHandleMap *FileHandleMap) Pop(id string) *FileHandle

Pop pops a file handle registered using ID and returns the handle

func (*FileHandleMap) PopAll

func (fileHandleMap *FileHandleMap) PopAll() []*FileHandle

PopAll pops all file handles registered (clear) and returns

func (*FileHandleMap) PopByPath

func (fileHandleMap *FileHandleMap) PopByPath(path string) []*FileHandle

PopByPath pops file handles registered using path and returns the handles

func (*FileHandleMap) Remove

func (fileHandleMap *FileHandleMap) Remove(id string)

Remove deletes a file handle registered using ID

func (*FileHandleMap) Rename

func (fileHandleMap *FileHandleMap) Rename(srcPath string, destPath string)

Rename renames files or dirs

func (*FileHandleMap) RenameDir

func (fileHandleMap *FileHandleMap) RenameDir(srcParentPath string, destParentPath string)

RenameDir renames files under parentPath

func (*FileHandleMap) RenameFile added in v0.9.0

func (fileHandleMap *FileHandleMap) RenameFile(srcPath string, destPath string)

RenameFile renames files

type IRODSFS

type IRODSFS struct {
	// contains filtered or unexported fields
}

IRODSFS is a file system object

func NewFileSystem

func NewFileSystem(config *commons.Config) (*IRODSFS, error)

NewFileSystem creates a new file system

func (*IRODSFS) GetNextOperationID

func (fs *IRODSFS) GetNextOperationID() uint64

GetNextOperationID returns next operation ID

func (*IRODSFS) Release added in v0.8.0

func (fs *IRODSFS) Release()

Release destroys the file system

func (*IRODSFS) Root

func (fs *IRODSFS) Root() (*Dir, error)

Root returns root directory node

func (*IRODSFS) Start added in v0.8.0

func (fs *IRODSFS) Start() error

Start starts FUSE

func (*IRODSFS) Stop added in v0.8.0

func (fs *IRODSFS) Stop()

func (*IRODSFS) Wait added in v0.8.0

func (fs *IRODSFS) Wait()

Jump to

Keyboard shortcuts

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