Aufs: reduce redundant parsing of mountinfo
Check whether or not the file system type of a mountpoint is aufs by calling statfs() instead of parsing mountinfo. This assumes that aufs graph driver does not allow aufs as a backing file system. Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
This commit is contained in:
parent
cb6cdb416c
commit
e8513675a2
1 changed files with 5 additions and 1 deletions
|
@ -468,7 +468,11 @@ func (a *Driver) unmount(m *data) error {
|
|||
}
|
||||
|
||||
func (a *Driver) mounted(m *data) (bool, error) {
|
||||
return mountpk.Mounted(m.path)
|
||||
var buf syscall.Statfs_t
|
||||
if err := syscall.Statfs(m.path, &buf); err != nil {
|
||||
return false, nil
|
||||
}
|
||||
return graphdriver.FsMagic(buf.Type) == graphdriver.FsMagicAufs, nil
|
||||
}
|
||||
|
||||
// Cleanup aufs and unmount all mountpoints
|
||||
|
|
Loading…
Reference in a new issue