aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/xattr.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-21 18:50:30 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-21 18:50:30 -0700
commit4f02f7121d232507bbbba825fa241bc8d5e630ff (patch)
treed9facd0b9188e459c0a483cb0891b97594ea1dd7 /weed/filesys/xattr.go
parentb8e4238ad29a60b37a3983a9968e325dd6849103 (diff)
downloadseaweedfs-4f02f7121d232507bbbba825fa241bc8d5e630ff.tar.xz
seaweedfs-4f02f7121d232507bbbba825fa241bc8d5e630ff.zip
read from meta cache
meta cache is not initialized
Diffstat (limited to 'weed/filesys/xattr.go')
-rw-r--r--weed/filesys/xattr.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/weed/filesys/xattr.go b/weed/filesys/xattr.go
index 1768c1d6e..7e7b8c60b 100644
--- a/weed/filesys/xattr.go
+++ b/weed/filesys/xattr.go
@@ -1,6 +1,8 @@
package filesys
import (
+ "context"
+
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
@@ -114,8 +116,13 @@ func (wfs *WFS) maybeLoadEntry(dir, name string) (entry *filer_pb.Entry, err err
}
// glog.V(3).Infof("read entry cache miss %s", fullpath)
+ // read from async meta cache
if wfs.option.AsyncMetaDataCaching {
-
+ cachedEntry, cacheErr := wfs.metaCache.FindEntry(context.Background(), fullpath)
+ if cacheErr == filer_pb.ErrNotFound {
+ return nil, fuse.ENOENT
+ }
+ return cachedEntry.ToProtoEntry(), nil
}
err = wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {