2018-02-05 16:05:59 -05:00
|
|
|
package zfs // import "github.com/docker/docker/daemon/graphdriver/zfs"
|
2015-05-28 11:38:08 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/daemon/graphdriver"
|
2017-07-26 17:42:13 -04:00
|
|
|
"github.com/sirupsen/logrus"
|
2015-05-28 11:38:08 -04:00
|
|
|
)
|
|
|
|
|
2017-07-24 03:23:45 -04: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 11:38:08 -04:00
|
|
|
}
|
|
|
|
|
2017-07-24 03:23:45 -04:00
|
|
|
if fsMagic != graphdriver.FsMagicZfs {
|
2018-03-05 10:09:41 -05:00
|
|
|
logrus.WithField("root", rootDir).WithField("backingFS", backingFS).WithField("storage-driver", "zfs").Error("No zfs dataset found for root")
|
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
|
|
|
|
}
|