mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03:00
mkdonut now creates a donut processing cli args
This commit is contained in:
@@ -17,22 +17,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/minio/minio/pkg/iodine"
|
||||
)
|
||||
|
||||
// IsUsable provides a comprehensive way of knowing if the provided mountPath is mounted and writable
|
||||
func IsUsable(mountPath string) (bool, error) {
|
||||
// isUsable provides a comprehensive way of knowing if the provided mountPath is mounted and writable
|
||||
func isUsable(mountPath string) (bool, error) {
|
||||
mntpoint, err := os.Stat(mountPath)
|
||||
if err != nil {
|
||||
return false, iodine.New(err, nil)
|
||||
}
|
||||
parent, err := os.Stat(filepath.Join(mountPath, ".."))
|
||||
parent, err := os.Stat("/")
|
||||
if err != nil {
|
||||
return false, iodine.New(err, nil)
|
||||
}
|
||||
@@ -40,7 +39,7 @@ func IsUsable(mountPath string) (bool, error) {
|
||||
parentSt := parent.Sys().(*syscall.Stat_t)
|
||||
|
||||
if mntpointSt.Dev == parentSt.Dev {
|
||||
return false, iodine.New(errors.New("not mounted"), nil)
|
||||
return false, iodine.New(fmt.Errorf("Not mounted %s", mountPath), nil)
|
||||
}
|
||||
testFile, err := ioutil.TempFile(mountPath, "writetest-")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user