Browse code

Merge pull request #20854 from inatatsu/reduce-parsing-mountinfo

Eliminate redundant parsing of mountinfo

Alexander Morozov authored on 2016/03/04 12:48:32
Showing 1 changed files
... ...
@@ -468,7 +468,11 @@ func (a *Driver) unmount(m *data) error {
468 468
 }
469 469
 
470 470
 func (a *Driver) mounted(m *data) (bool, error) {
471
-	return mountpk.Mounted(m.path)
471
+	var buf syscall.Statfs_t
472
+	if err := syscall.Statfs(m.path, &buf); err != nil {
473
+		return false, nil
474
+	}
475
+	return graphdriver.FsMagic(buf.Type) == graphdriver.FsMagicAufs, nil
472 476
 }
473 477
 
474 478
 // Cleanup aufs and unmount all mountpoints