зеркало из https://github.com/microsoft/docker.git
Merge pull request #19873 from HackToday/refactorfs
Make btrfs call same interface as others
This commit is contained in:
Коммит
967848419a
|
@ -31,14 +31,13 @@ func init() {
|
||||||
// Init returns a new BTRFS driver.
|
// Init returns a new BTRFS driver.
|
||||||
// An error is returned if BTRFS is not supported.
|
// An error is returned if BTRFS is not supported.
|
||||||
func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
|
func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) {
|
||||||
rootdir := path.Dir(home)
|
|
||||||
|
|
||||||
var buf syscall.Statfs_t
|
fsMagic, err := graphdriver.GetFSMagic(home)
|
||||||
if err := syscall.Statfs(rootdir, &buf); err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicBtrfs {
|
if fsMagic != graphdriver.FsMagicBtrfs {
|
||||||
return nil, graphdriver.ErrPrerequisites
|
return nil, graphdriver.ErrPrerequisites
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче