2015-05-28 11:38:08 -04:00
|
|
|
package zfs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"syscall"
|
|
|
|
|
2015-07-28 22:58:50 -04:00
|
|
|
"github.com/Sirupsen/logrus"
|
2015-05-28 11:38:08 -04:00
|
|
|
"github.com/docker/docker/daemon/graphdriver"
|
|
|
|
)
|
|
|
|
|
|
|
|
func checkRootdirFs(rootdir string) error {
|
|
|
|
var buf syscall.Statfs_t
|
|
|
|
if err := syscall.Statfs(rootdir, &buf); err != nil {
|
|
|
|
return fmt.Errorf("Failed to access '%s': %s", rootdir, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicZfs {
|
2015-07-28 22:58:50 -04:00
|
|
|
logrus.Debugf("[zfs] no zfs dataset found for rootdir '%s'", rootdir)
|
2015-05-28 11:38:08 -04:00
|
|
|
return graphdriver.ErrPrerequisites
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2015-05-29 09:33:04 -04:00
|
|
|
|
|
|
|
func getMountpoint(id string) string {
|
|
|
|
return id
|
|
|
|
}
|