2018-02-05 16:05:59 -05:00
|
|
|
package zfs // import "github.com/docker/docker/daemon/graphdriver/zfs"
|
2015-05-28 18:38:08 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/daemon/graphdriver"
|
2017-07-26 14:42:13 -07:00
|
|
|
"github.com/sirupsen/logrus"
|
2015-05-28 18:38:08 +03:00
|
|
|
)
|
|
|
|
|
2017-07-24 01:23:45 -06:00
|
|
|
func checkRootdirFs(rootDir string) error {
|
|
|
|
fsMagic, err := graphdriver.GetFSMagic(rootDir)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
backingFS := "unknown"
|
|
|
|
if fsName, ok := graphdriver.FsNames[fsMagic]; ok {
|
|
|
|
backingFS = fsName
|
2015-05-28 18:38:08 +03:00
|
|
|
}
|
|
|
|
|
2017-07-24 01:23:45 -06:00
|
|
|
if fsMagic != graphdriver.FsMagicZfs {
|
2018-03-05 16:09:41 +01:00
|
|
|
logrus.WithField("root", rootDir).WithField("backingFS", backingFS).WithField("storage-driver", "zfs").Error("No zfs dataset found for root")
|
2015-05-28 18:38:08 +03:00
|
|
|
return graphdriver.ErrPrerequisites
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
2015-05-29 16:33:04 +03:00
|
|
|
|
|
|
|
func getMountpoint(id string) string {
|
|
|
|
return id
|
|
|
|
}
|