mirror of
https://github.com/minio/minio.git
synced 2025-11-10 05:59:43 -05:00
posix: Fix windows performance issues. (#3132)
Do not attempt to fetch volume/drive information for each i/o situation. In our case we do this in all calls `posix.go` this in-turn created a terrible situation for windows. This issue does not affect the i/o path on Unix platforms since statvfs calls are in the range of micro seconds on these platforms. This verification is only needed during startup and we let things fail at a later stage on windows.
This commit is contained in:
@@ -42,7 +42,7 @@ func isSysErrIO(err error) bool {
|
||||
return err != nil && err == syscall.EIO
|
||||
}
|
||||
|
||||
// Check if the given error corresponds to ENOTDIR (is not a directory)
|
||||
// Check if the given error corresponds to ENOTDIR (is not a directory).
|
||||
func isSysErrNotDir(err error) bool {
|
||||
if pathErr, ok := err.(*os.PathError); ok {
|
||||
switch pathErr.Err {
|
||||
@@ -53,8 +53,19 @@ func isSysErrNotDir(err error) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if the given error corresponds to the ENAMETOOLONG (name too long).
|
||||
func isSysErrTooLong(err error) bool {
|
||||
if pathErr, ok := err.(*os.PathError); ok {
|
||||
switch pathErr.Err {
|
||||
case syscall.ENAMETOOLONG:
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if the given error corresponds to ENOTEMPTY for unix
|
||||
// and ERROR_DIR_NOT_EMPTY for windows (directory not empty)
|
||||
// and ERROR_DIR_NOT_EMPTY for windows (directory not empty).
|
||||
func isSysErrNotEmpty(err error) bool {
|
||||
if pathErr, ok := err.(*os.PathError); ok {
|
||||
if runtime.GOOS == "windows" {
|
||||
|
||||
Reference in New Issue
Block a user