mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 14:10:25 +03:00
trace: Add bucket/prefix to WalkDir() tracing (#12510)
Bonus, replace os.* API with os-instrumented.go
This commit is contained in:
@@ -107,7 +107,7 @@ func readDir(dirPath string) (entries []string, err error) {
|
||||
// the directory itself, if the dirPath doesn't exist this function doesn't return
|
||||
// an error.
|
||||
func readDirFn(dirPath string, fn func(name string, typ os.FileMode) error) error {
|
||||
f, err := os.Open(dirPath)
|
||||
f, err := Open(dirPath)
|
||||
if err != nil {
|
||||
if osErrToFileErr(err) == errFileNotFound {
|
||||
return nil
|
||||
@@ -185,7 +185,7 @@ func readDirFn(dirPath string, fn func(name string, typ os.FileMode) error) erro
|
||||
// Return count entries at the directory dirPath and all entries
|
||||
// if count is set to -1
|
||||
func readDirN(dirPath string, count int) (entries []string, err error) {
|
||||
f, err := os.Open(dirPath)
|
||||
f, err := Open(dirPath)
|
||||
if err != nil {
|
||||
return nil, osErrToFileErr(err)
|
||||
}
|
||||
@@ -229,7 +229,7 @@ func readDirN(dirPath string, count int) (entries []string, err error) {
|
||||
// support Dirent.Type and have DT_UNKNOWN (0) there
|
||||
// instead.
|
||||
if typ == unexpectedFileMode || typ&os.ModeSymlink == os.ModeSymlink {
|
||||
fi, err := os.Stat(pathJoin(dirPath, string(name)))
|
||||
fi, err := Stat(pathJoin(dirPath, string(name)))
|
||||
if err != nil {
|
||||
// It got deleted in the meantime, not found
|
||||
// or returns too many symlinks ignore this
|
||||
|
||||
Reference in New Issue
Block a user