mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
48b1dd0084
Fixes #9960 This adds the output of a "Backing Filesystem:" entry to `docker info` to overlay, aufs, and devicemapper graphdrivers. The default list includes a fairly complete list of common filesystem names from linux/include/uapi/linux/magic.h, but if the backing filesystem is not recognized, the code will simply show "<unknown>" Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
14 lines
248 B
Go
14 lines
248 B
Go
package graphdriver
|
|
|
|
import (
|
|
"path"
|
|
"syscall"
|
|
)
|
|
|
|
func GetFSMagic(rootpath string) (FsMagic, error) {
|
|
var buf syscall.Statfs_t
|
|
if err := syscall.Statfs(path.Dir(rootpath), &buf); err != nil {
|
|
return 0, err
|
|
}
|
|
return FsMagic(buf.Type), nil
|
|
}
|