fs

package
v0.0.0-...-005c2ad Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Package fs implements an AIStore file system.

  • Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	FilePermissionBits      os.FileMode = cos.PermRWR
	DirectoryPermissionBits os.FileMode = cos.PermRWXRX
)
View Source
const (
	Name = "aisfs"
)

Variables

This section is empty.

Functions

func NewAISFileSystemServer

func NewAISFileSystemServer(cfg *ServerConfig, errLog *log.Logger) (srv fuse.Server, err error)

Types

type AttrUpdateReq

type AttrUpdateReq struct {
	Mode  *os.FileMode
	Size  *uint64
	Atime *time.Time
	Mtime *time.Time
}

AttrUpdateReq is a request struct for updating inode attributes corresponding to non-nil struct fields.

type DirectoryInode

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

func (*DirectoryInode) AsChildEntry

func (in *DirectoryInode) AsChildEntry() (en fuseops.ChildInodeEntry)

AsChildEntry returns a fuseops.ChildInodeEntry struct constructed from the current inode state. REQUIRES_READ_LOCK(in)

func (*DirectoryInode) Attributes

func (in *DirectoryInode) Attributes() (attrs fuseops.InodeAttributes)

Attributes returns inode's attributes (mode, size, atime...). REQUIRES_READ_LOCK(in)

func (*DirectoryInode) DecLookupCountN

func (in *DirectoryInode) DecLookupCountN(n uint64) uint64

DecLookupCountN atomically decrements inode's lookup count by n.

func (*DirectoryInode) Destroy

func (*DirectoryInode) Destroy() error

Destroy releases all resources allocated by the inode.

func (*DirectoryInode) ForgetDir

func (dir *DirectoryInode) ForgetDir(entryName string)

REQUIRES_LOCK(dir)

func (*DirectoryInode) ForgetFile

func (dir *DirectoryInode) ForgetFile(entryName string)

REQUIRES_LOCK(dir)

func (*DirectoryInode) ID

func (in *DirectoryInode) ID() fuseops.InodeID

ID returns inode number (ID).

func (*DirectoryInode) IncLookupCount

func (in *DirectoryInode) IncLookupCount()

IncLookupCount atomically increments inode's lookup count.

func (*DirectoryInode) InvalidateInode

func (dir *DirectoryInode) InvalidateInode(entryName string, isDir bool)

func (*DirectoryInode) IsDir

func (*DirectoryInode) IsDir() bool

func (*DirectoryInode) LinkNewFile

func (dir *DirectoryInode) LinkNewFile(fileName string) (*ais.Object, error)

func (*DirectoryInode) LookupEntry

func (dir *DirectoryInode) LookupEntry(entryName string) (res EntryLookupResult)

func (*DirectoryInode) NewDirEntry

func (dir *DirectoryInode) NewDirEntry(entryName string, id fuseops.InodeID)

REQUIRES_LOCK(dir)

func (*DirectoryInode) NewFileEntry

func (dir *DirectoryInode) NewFileEntry(entryName string, id fuseops.InodeID, object *ais.Object)

REQUIRES_LOCK(dir)

func (*DirectoryInode) Parent

func (dir *DirectoryInode) Parent() Inode

func (*DirectoryInode) Path

func (in *DirectoryInode) Path() string

Path returns a path that maps to an inode. The file system does not support hard links, so there is only one path for each inode. NOTE: Path does not start with a separator.

func (*DirectoryInode) ReadEntries

func (dir *DirectoryInode) ReadEntries() (entries []fuseutil.Dirent, err error)

REQUIRES_LOCK(dir)

func (*DirectoryInode) SetAttributes

func (in *DirectoryInode) SetAttributes(attrs fuseops.InodeAttributes)

SetAttributes sets inode attributes. REQUIRES_LOCK(in)

func (*DirectoryInode) UnlinkEntry

func (dir *DirectoryInode) UnlinkEntry(entryName string) error

LOCKS(dir)

func (*DirectoryInode) UpdateAttributes

func (dir *DirectoryInode) UpdateAttributes(req *AttrUpdateReq) fuseops.InodeAttributes

REQUIRES_LOCK(dir)

type EntryLookupResult

type EntryLookupResult struct {
	Entry  *fuseutil.Dirent
	Object *ais.Object
}

EntryLookupResult is a struct returned as a result of directory entry lookup.

func (EntryLookupResult) IsDir

func (res EntryLookupResult) IsDir() bool

IsDir checks if an entry maps to a directory.

func (EntryLookupResult) NoEntry

func (res EntryLookupResult) NoEntry() bool

NoEntry checks if lookup operation found an entry.

func (EntryLookupResult) NoInode

func (res EntryLookupResult) NoInode() bool

NoInode checks if inode number is known for an entry.

type FileInode

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

func (*FileInode) AsChildEntry

func (in *FileInode) AsChildEntry() (en fuseops.ChildInodeEntry)

AsChildEntry returns a fuseops.ChildInodeEntry struct constructed from the current inode state. REQUIRES_READ_LOCK(in)

func (*FileInode) Attributes

func (in *FileInode) Attributes() (attrs fuseops.InodeAttributes)

Attributes returns inode's attributes (mode, size, atime...). REQUIRES_READ_LOCK(in)

func (*FileInode) DecLookupCountN

func (in *FileInode) DecLookupCountN(n uint64) uint64

DecLookupCountN atomically decrements inode's lookup count by n.

func (*FileInode) Destroy

func (*FileInode) Destroy() error

Destroy releases all resources allocated by the inode.

func (*FileInode) Flush

func (file *FileInode) Flush(handle string, cksum *cos.Cksum) error

REQUIRES_LOCK(file)

func (*FileInode) ID

func (in *FileInode) ID() fuseops.InodeID

ID returns inode number (ID).

func (*FileInode) IncLookupCount

func (in *FileInode) IncLookupCount()

IncLookupCount atomically increments inode's lookup count.

func (*FileInode) IsDir

func (*FileInode) IsDir() bool

func (*FileInode) Load

func (file *FileInode) Load(w io.Writer, offset, length int64) (n int64, err error)

REQUIRES_READ_LOCK(file)

func (*FileInode) Parent

func (file *FileInode) Parent() Inode

func (*FileInode) Path

func (in *FileInode) Path() string

Path returns a path that maps to an inode. The file system does not support hard links, so there is only one path for each inode. NOTE: Path does not start with a separator.

func (*FileInode) SetAttributes

func (in *FileInode) SetAttributes(attrs fuseops.InodeAttributes)

SetAttributes sets inode attributes. REQUIRES_LOCK(in)

func (*FileInode) SetSize

func (file *FileInode) SetSize(size uint64)

REQUIRES_LOCK(file)

func (*FileInode) Size

func (file *FileInode) Size() uint64

REQUIRES_READ_LOCK(file)

func (*FileInode) UpdateAttributes

func (file *FileInode) UpdateAttributes(req *AttrUpdateReq) fuseops.InodeAttributes

REQUIRES_LOCK(file)

func (*FileInode) UpdateBackingObject

func (file *FileInode) UpdateBackingObject(obj *ais.Object)

REQUIRES_LOCK(file)

func (*FileInode) Write

func (file *FileInode) Write(r cos.ReadOpenCloser, handle string, size int64) (string, error)

REQUIRES_LOCK(file)

type Inode

type Inode interface {
	// Locking
	sync.Locker
	RLock()
	RUnlock()

	// General
	Parent() Inode
	ID() fuseops.InodeID
	Path() string
	IsDir() bool
	Destroy() error

	// Attributes
	Attributes() fuseops.InodeAttributes
	UpdateAttributes(*AttrUpdateReq) fuseops.InodeAttributes
	AsChildEntry() fuseops.ChildInodeEntry

	// Lookup count
	IncLookupCount()
	DecLookupCountN(n uint64) uint64
}

func NewDirectoryInode

func NewDirectoryInode(id fuseops.InodeID, attrs fuseops.InodeAttributes, path string, parent *DirectoryInode, bucket ais.Bucket) Inode

func NewFileInode

func NewFileInode(id fuseops.InodeID, attrs fuseops.InodeAttributes, parent *DirectoryInode, object *ais.Object) Inode

type ModeBits

type ModeBits struct {
	File      os.FileMode
	Directory os.FileMode
}

type Owner

type Owner struct {
	UID uint32
	GID uint32
}

type ServerConfig

type ServerConfig struct {
	// Mount
	MountPath string

	// Cluster
	AISURL        string
	BucketName    string
	SkipVerifyCrt bool

	// Access
	Owner *Owner

	// Timeouts, tunables...
	TCPTimeout      time.Duration
	HTTPTimeout     time.Duration
	SyncInterval    atomic.Int64
	MemoryLimit     atomic.Uint64
	MaxWriteBufSize atomic.Int64
}

Jump to

Keyboard shortcuts

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