fix: Optimize listing calls for NFS mounts (#13159)

--no-compat should allow for some optimized
behavior for NFS mounts by removing Stat()
operations.
This commit is contained in:
Harshavardhana
2021-09-08 08:15:42 -07:00
committed by GitHub
parent 9c5fd6a776
commit 951b1e6a7a
3 changed files with 15 additions and 11 deletions

View File

@@ -854,6 +854,15 @@ func (fs *FSObjects) getObjectInfoNoFSLock(ctx context.Context, bucket, object s
return fsMeta.ToObjectInfo(bucket, object, fi), nil
}
if !globalCLIContext.StrictS3Compat {
// Stat the file to get file size.
fi, err := fsStatFile(ctx, pathJoin(fs.fsPath, bucket, object))
if err != nil {
return oi, err
}
return fsMeta.ToObjectInfo(bucket, object, fi), nil
}
fsMetaPath := pathJoin(fs.fsPath, minioMetaBucket, bucketMetaPrefix, bucket, object, fs.metaJSONFile)
// Read `fs.json` to perhaps contend with
// parallel Put() operations.