Add support of fallocate for FS and XL backends (#3032)

This commit is contained in:
Anis Elleuch
2016-10-29 20:44:44 +01:00
committed by Harshavardhana
parent 0b3282ac9f
commit a47ce7ab22
17 changed files with 415 additions and 50 deletions

View File

@@ -22,6 +22,26 @@ import (
"syscall"
)
// Function not implemented error
func isSysErrNoSys(err error) bool {
return err != nil && err == syscall.ENOSYS
}
// Not supported error
func isSysErrOpNotSupported(err error) bool {
return err != nil && err == syscall.EOPNOTSUPP
}
// No space left on device error
func isSysErrNoSpace(err error) bool {
return err != nil && err == syscall.ENOSPC
}
// Input/output error
func isSysErrIO(err error) bool {
return err != nil && err == syscall.EIO
}
// Check if the given error corresponds to ENOTDIR (is not a directory)
func isSysErrNotDir(err error) bool {
if pathErr, ok := err.(*os.PathError); ok {