From feda5d768439c6ecb8d3c82cee332724302e7cd2 Mon Sep 17 00:00:00 2001 From: "Kai Qiang Wu(Kennan)" Date: Mon, 1 Feb 2016 07:50:16 +0000 Subject: [PATCH] Make btrfs call same interface as others Most storage drivers call graphdriver.GetFSMagic(home), it is more clean to easy to maintain. So btrfs need to adopt such change. Signed-off-by: Kai Qiang Wu(Kennan) --- daemon/graphdriver/btrfs/btrfs.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/daemon/graphdriver/btrfs/btrfs.go b/daemon/graphdriver/btrfs/btrfs.go index 86aa631b75..d9750c95b2 100644 --- a/daemon/graphdriver/btrfs/btrfs.go +++ b/daemon/graphdriver/btrfs/btrfs.go @@ -31,14 +31,13 @@ func init() { // Init returns a new BTRFS driver. // An error is returned if BTRFS is not supported. func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (graphdriver.Driver, error) { - rootdir := path.Dir(home) - var buf syscall.Statfs_t - if err := syscall.Statfs(rootdir, &buf); err != nil { + fsMagic, err := graphdriver.GetFSMagic(home) + if err != nil { return nil, err } - if graphdriver.FsMagic(buf.Type) != graphdriver.FsMagicBtrfs { + if fsMagic != graphdriver.FsMagicBtrfs { return nil, graphdriver.ErrPrerequisites }