diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-10-16 01:05:48 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-10-16 01:05:48 -0700 |
| commit | 8e3075d051fc386b5ce3fdfba8370c4d70592464 (patch) | |
| tree | 53d53398f99700ac97432e0fefdfda97e3f2988f | |
| parent | 822ee2475b2e17ddf3dde81da658169ba8c517d0 (diff) | |
| download | seaweedfs-8e3075d051fc386b5ce3fdfba8370c4d70592464.tar.xz seaweedfs-8e3075d051fc386b5ce3fdfba8370c4d70592464.zip | |
ensure file entry chunks have populated the file id
| -rw-r--r-- | weed/filer/filerstore_wrapper.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/weed/filer/filerstore_wrapper.go b/weed/filer/filerstore_wrapper.go index 4ded40fb1..705f6635b 100644 --- a/weed/filer/filerstore_wrapper.go +++ b/weed/filer/filerstore_wrapper.go @@ -253,13 +253,14 @@ func (fsw *FilerStoreWrapper) ListDirectoryPrefixedEntries(ctx context.Context, limit = math.MaxInt32 - 1 } glog.V(4).Infof("ListDirectoryPrefixedEntries %s from %s prefix %s limit %d", dirPath, startFileName, prefix, limit) - lastFileName, err = actualStore.ListDirectoryPrefixedEntries(ctx, dirPath, startFileName, includeStartFile, limit, prefix, eachEntryFunc) + adjustedEntryFunc := func(entry *Entry) bool { + fsw.maybeReadHardLink(ctx, entry) + filer_pb.AfterEntryDeserialization(entry.Chunks) + return eachEntryFunc(entry) + } + lastFileName, err = actualStore.ListDirectoryPrefixedEntries(ctx, dirPath, startFileName, includeStartFile, limit, prefix, adjustedEntryFunc) if err == ErrUnsupportedListDirectoryPrefixed { - lastFileName, err = fsw.prefixFilterEntries(ctx, dirPath, startFileName, includeStartFile, limit, prefix, func(entry *Entry) bool { - fsw.maybeReadHardLink(ctx, entry) - filer_pb.AfterEntryDeserialization(entry.Chunks) - return eachEntryFunc(entry) - }) + lastFileName, err = fsw.prefixFilterEntries(ctx, dirPath, startFileName, includeStartFile, limit, prefix, adjustedEntryFunc) } return lastFileName, err } |
