Documentation ¶
Index ¶
- func IsDir(fs fuse.FileSystem, name string) bool
- type AutoUnionFs
- func (me *AutoUnionFs) GetAttr(path string) (*os.FileInfo, fuse.Status)
- func (me *AutoUnionFs) GetXAttr(name string, attr string) ([]byte, fuse.Status)
- func (me *AutoUnionFs) Mount(connector *fuse.FileSystemConnector) fuse.Status
- func (me *AutoUnionFs) Open(path string, flags uint32) (fuse.File, fuse.Status)
- func (me *AutoUnionFs) OpenDir(name string) (stream chan fuse.DirEntry, status fuse.Status)
- func (me *AutoUnionFs) Readlink(path string) (out string, code fuse.Status)
- func (me *AutoUnionFs) StatusDir() (stream chan fuse.DirEntry, status fuse.Status)
- func (me *AutoUnionFs) Symlink(pointedTo string, linkName string) (code fuse.Status)
- func (me *AutoUnionFs) Truncate(name string, offset uint64) (code fuse.Status)
- func (me *AutoUnionFs) Unlink(path string) (code fuse.Status)
- func (me *AutoUnionFs) VisitDir(path string, f *os.FileInfo) bool
- func (me *AutoUnionFs) VisitFile(path string, f *os.FileInfo)
- type AutoUnionFsOptions
- type CachingFileSystem
- func (me *CachingFileSystem) DisabledOpen(name string, flags uint32) (f fuse.File, status fuse.Status)
- func (me *CachingFileSystem) DropCache()
- func (me *CachingFileSystem) GetAttr(name string) (*os.FileInfo, fuse.Status)
- func (me *CachingFileSystem) GetXAttr(name string, attr string) ([]byte, fuse.Status)
- func (me *CachingFileSystem) OpenDir(name string) (stream chan fuse.DirEntry, status fuse.Status)
- func (me *CachingFileSystem) Readlink(name string) (string, fuse.Status)
- type DirCache
- type TimedCache
- func (me *TimedCache) DropAll()
- func (me *TimedCache) DropEntry(name string)
- func (me *TimedCache) Get(name string) interface{}
- func (me *TimedCache) GetFresh(name string) interface{}
- func (me *TimedCache) Purge()
- func (me *TimedCache) RecurringPurge()
- func (me *TimedCache) Set(name string, val interface{})
- type UnionFs
- func (me *UnionFs) Access(name string, mode uint32) (code fuse.Status)
- func (me *UnionFs) Chmod(name string, mode uint32) (code fuse.Status)
- func (me *UnionFs) Chown(name string, uid uint32, gid uint32) (code fuse.Status)
- func (me *UnionFs) Create(name string, flags uint32, mode uint32) (fuseFile fuse.File, code fuse.Status)
- func (me *UnionFs) DropCaches()
- func (me *UnionFs) Flush(name string) fuse.Status
- func (me *UnionFs) GetAttr(name string) (a *os.FileInfo, s fuse.Status)
- func (me *UnionFs) GetXAttr(name string, attr string) ([]byte, fuse.Status)
- func (me *UnionFs) Mkdir(path string, mode uint32) (code fuse.Status)
- func (me *UnionFs) Name() string
- func (me *UnionFs) Open(name string, flags uint32) (fuseFile fuse.File, status fuse.Status)
- func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status fuse.Status)
- func (me *UnionFs) Promote(name string, srcResult branchResult) fuse.Status
- func (me *UnionFs) Readlink(name string) (out string, code fuse.Status)
- func (me *UnionFs) Rename(src string, dst string) (code fuse.Status)
- func (me *UnionFs) Rmdir(path string) (code fuse.Status)
- func (me *UnionFs) Symlink(pointedTo string, linkName string) (code fuse.Status)
- func (me *UnionFs) Truncate(path string, offset uint64) (code fuse.Status)
- func (me *UnionFs) Unlink(name string) (code fuse.Status)
- func (me *UnionFs) Utimens(name string, atime uint64, mtime uint64) (code fuse.Status)
- type UnionFsOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutoUnionFs ¶
type AutoUnionFs struct { fuse.DefaultFileSystem // contains filtered or unexported fields }
Creates unions for all files under a given directory, walking the tree and looking for directories D which have a D/READONLY symlink.
A union for A/B/C will placed under directory A-B-C.
func NewAutoUnionFs ¶
func NewAutoUnionFs(directory string, options AutoUnionFsOptions) *AutoUnionFs
func (*AutoUnionFs) Mount ¶
func (me *AutoUnionFs) Mount(connector *fuse.FileSystemConnector) fuse.Status
func (*AutoUnionFs) Readlink ¶
func (me *AutoUnionFs) Readlink(path string) (out string, code fuse.Status)
func (*AutoUnionFs) StatusDir ¶
func (me *AutoUnionFs) StatusDir() (stream chan fuse.DirEntry, status fuse.Status)
func (*AutoUnionFs) Symlink ¶
func (me *AutoUnionFs) Symlink(pointedTo string, linkName string) (code fuse.Status)
func (*AutoUnionFs) Truncate ¶
func (me *AutoUnionFs) Truncate(name string, offset uint64) (code fuse.Status)
type AutoUnionFsOptions ¶
type AutoUnionFsOptions struct { UnionFsOptions fuse.FileSystemOptions // If set, run updateKnownFses() after mounting. UpdateOnMount bool }
type CachingFileSystem ¶
type CachingFileSystem struct { fuse.FileSystem // contains filtered or unexported fields }
Caches filesystem metadata.
func NewCachingFileSystem ¶
func NewCachingFileSystem(fs fuse.FileSystem, ttlNs int64) *CachingFileSystem
func (*CachingFileSystem) DisabledOpen ¶
func (me *CachingFileSystem) DisabledOpen(name string, flags uint32) (f fuse.File, status fuse.Status)
Caching file contents easily overflows available memory.
func (*CachingFileSystem) DropCache ¶
func (me *CachingFileSystem) DropCache()
type DirCache ¶
type DirCache struct {
// contains filtered or unexported fields
}
DirCache caches names in a directory for some time.
If called when the cache is expired, the filenames are read afresh in the background.
func NewDirCache ¶
func NewDirCache(fs fuse.FileSystem, dir string, ttlNs int64) *DirCache
func (*DirCache) RemoveEntry ¶
type TimedCache ¶
TimedIntCache caches the result of fetch() for some time. It is thread-safe.
func NewTimedCache ¶
func NewTimedCache(fetcher func(name string) interface{}, ttlNs int64) *TimedCache
Creates a new cache with the given TTL. If TTL <= 0, the caching is indefinite.
func (*TimedCache) DropAll ¶
func (me *TimedCache) DropAll()
func (*TimedCache) DropEntry ¶
func (me *TimedCache) DropEntry(name string)
func (*TimedCache) Get ¶
func (me *TimedCache) Get(name string) interface{}
func (*TimedCache) GetFresh ¶
func (me *TimedCache) GetFresh(name string) interface{}
func (*TimedCache) RecurringPurge ¶
func (me *TimedCache) RecurringPurge()
func (*TimedCache) Set ¶
func (me *TimedCache) Set(name string, val interface{})
type UnionFs ¶
type UnionFs struct { fuse.DefaultFileSystem // contains filtered or unexported fields }
UnionFs implements a user-space union file system, which is stateless but efficient even if the writable branch is on NFS.
Assumptions:
* It uses a list of branches, the first of which (index 0) is thought to be writable, and the rest read-only.
* It assumes that the number of deleted files is small relative to the total tree size.
Implementation notes.
- It overlays arbitrary writable FileSystems with any number of readonly FileSystems.
* Deleting a file will put a file named /DELETIONS/HASH-OF-FULL-FILENAME into the writable overlay, containing the full filename itself.
This is optimized for NFS usage: we want to minimize the number of NFS operations, which are slow. By putting all whiteouts in one place, we can cheaply fetch the list of all deleted files. Even without caching on our side, the kernel's negative dentry cache can answer is-deleted queries quickly.
func NewUnionFs ¶
func NewUnionFs(name string, fileSystems []fuse.FileSystem, options UnionFsOptions) *UnionFs
func NewUnionFsFromRoots ¶
func NewUnionFsFromRoots(roots []string, opts *UnionFsOptions) (*UnionFs, os.Error)
func (*UnionFs) DropCaches ¶
func (me *UnionFs) DropCaches()