diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-28 12:16:53 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-28 12:16:53 -0800 |
| commit | fcf371444356b98d7f1c169068ee2a890889c122 (patch) | |
| tree | 20ebab68fb9cc96de6249b184fb685c538c7e089 /weed/mount/weedfs.go | |
| parent | ca0cd81a75b1bdce429ab3b32724bf6a40097a03 (diff) | |
| download | seaweedfs-fcf371444356b98d7f1c169068ee2a890889c122.tar.xz seaweedfs-fcf371444356b98d7f1c169068ee2a890889c122.zip | |
mount: add back support for filer.path
Diffstat (limited to 'weed/mount/weedfs.go')
| -rw-r--r-- | weed/mount/weedfs.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index 157d385c7..0e5489198 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -73,7 +73,7 @@ func NewSeaweedFileSystem(option *Option) *WFS { RawFileSystem: fuse.NewDefaultRawFileSystem(), option: option, signature: util.RandomInt32(), - inodeToPath: NewInodeToPath(), + inodeToPath: NewInodeToPath(util.FullPath(option.FilerMountRootPath)), fhmap: NewFileHandleToInode(), dhmap: NewDirectoryHandleToInode(), } @@ -84,12 +84,14 @@ func NewSeaweedFileSystem(option *Option) *WFS { wfs.chunkCache = chunk_cache.NewTieredChunkCache(256, option.getUniqueCacheDir(), option.CacheSizeMB, 1024*1024) } - wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.getUniqueCacheDir(), "meta"), option.UidGidMapper, func(path util.FullPath) { - wfs.inodeToPath.MarkChildrenCached(path) - }, func(path util.FullPath) bool { - return wfs.inodeToPath.IsChildrenCached(path) - }, func(filePath util.FullPath, entry *filer_pb.Entry) { - }) + wfs.metaCache = meta_cache.NewMetaCache(path.Join(option.getUniqueCacheDir(), "meta"), option.UidGidMapper, + util.FullPath(option.FilerMountRootPath), + func(path util.FullPath) { + wfs.inodeToPath.MarkChildrenCached(path) + }, func(path util.FullPath) bool { + return wfs.inodeToPath.IsChildrenCached(path) + }, func(filePath util.FullPath, entry *filer_pb.Entry) { + }) grace.OnInterrupt(func() { wfs.metaCache.Shutdown() os.RemoveAll(option.getUniqueCacheDir()) |
