xl: Avoid called getdents for folders in listing (#19100)

This commit is contained in:
Anis Eleuch
2024-03-01 17:01:28 +01:00
committed by GitHub
parent 2c2f5d871c
commit 8f03c6e0db
3 changed files with 62 additions and 9 deletions

View File

@@ -195,15 +195,6 @@ func getValidPath(path string) (string, error) {
return path, nil
}
// isDirEmpty - returns whether given directory is empty or not.
func isDirEmpty(dirname string) bool {
entries, err := readDirN(dirname, 1)
if err != nil {
return false
}
return len(entries) == 0
}
// Initialize a new storage disk.
func newLocalXLStorage(path string) (*xlStorage, error) {
u := url.URL{Path: path}