Browse Source

Merge pull request #19873 from HackToday/refactorfs

Make btrfs call same interface as others
Brian Goff 9 năm trước cách đây
mục cha
commit
967848419a
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      daemon/graphdriver/btrfs/btrfs.go

+ 3 - 4
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
 	}