diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-04-14 23:21:24 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-04-14 23:21:24 -0700 |
| commit | 36c79de3f4110e52ea83383fc6b8d3780504968b (patch) | |
| tree | e66bf2e023c3d192d58d81ddcc48944d83c00f84 | |
| parent | e41766feb6ca05090ab3730762c2b6e9093ea4f7 (diff) | |
| download | seaweedfs-36c79de3f4110e52ea83383fc6b8d3780504968b.tar.xz seaweedfs-36c79de3f4110e52ea83383fc6b8d3780504968b.zip | |
fuse mount: dir ReadDirAll avoid extra conversion to filer_pb.Entry
| -rw-r--r-- | weed/filesys/dir.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index e51fbbee5..8880d3506 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -320,12 +320,12 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) { dirPath := util.FullPath(dir.FullPath()) glog.V(4).Infof("dir ReadDirAll %s", dirPath) - processEachEntryFn := func(entry *filer_pb.Entry, isLast bool) error { - if entry.IsDirectory { - dirent := fuse.Dirent{Name: entry.Name, Type: fuse.DT_Dir} + processEachEntryFn := func(entry *filer.Entry, isLast bool) error { + if entry.IsDirectory() { + dirent := fuse.Dirent{Name: entry.Name(), Type: fuse.DT_Dir} ret = append(ret, dirent) } else { - dirent := fuse.Dirent{Name: entry.Name, Type: findFileType(uint16(entry.Attributes.FileMode))} + dirent := fuse.Dirent{Name: entry.Name(), Type: findFileType(uint16(entry.Attr.Mode))} ret = append(ret, dirent) } return nil @@ -336,7 +336,7 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) { return nil, fuse.EIO } listErr := dir.wfs.metaCache.ListDirectoryEntries(context.Background(), dirPath, "", false, int64(math.MaxInt32), func(entry *filer.Entry) bool { - processEachEntryFn(entry.ToProtoEntry(), false) + processEachEntryFn(entry, false) return true }) if listErr != nil { |
