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:
Harshavardhana
2016-10-31 09:34:44 -07:00
committed by GitHub
parent a773a6dce6
commit f3c6c55719
6 changed files with 160 additions and 78 deletions

View File

@@ -536,23 +536,6 @@ func TestListVols(t *testing.T) {
if _, err = posixStorage.ListVols(); err != errDiskNotFound {
t.Errorf("Expected to fail with \"%s\", but instead failed with \"%s\"", errDiskNotFound, err)
}
// creating a new posix instance.
posixStorage, path, err = newPosixTestSetup()
if err != nil {
t.Fatalf("Unable to create posix test setup, %s", err)
}
defer removeAll(path)
// adding the segment of the path length of the volume to be > 255.
if posixType, ok := posixStorage.(*posix); ok {
// setting the disk Path with name whose segment length > 255.
posixType.diskPath = "my-vol-name-0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
} else {
t.Errorf("Expected the StorageAPI to be of type *posix")
}
if _, err = posixStorage.ListVols(); err != errFileNameTooLong {
t.Errorf("Expected to fail with \"%s\", but instead failed with \"%s\"", errFileNameTooLong, err)
}
}
// TestPosixListDir - Tests validate the directory listing functionality provided by posix.ListDir .