|
@@ -14,8 +14,52 @@ import (
|
|
|
type FsMagic uint32
|
|
|
|
|
|
const (
|
|
|
- FsMagicBtrfs = FsMagic(0x9123683E)
|
|
|
- FsMagicAufs = FsMagic(0x61756673)
|
|
|
+ FsMagicBtrfs = FsMagic(0x9123683E)
|
|
|
+ FsMagicAufs = FsMagic(0x61756673)
|
|
|
+ FsMagicExtfs = FsMagic(0x0000EF53)
|
|
|
+ FsMagicCramfs = FsMagic(0x28cd3d45)
|
|
|
+ FsMagicRamFs = FsMagic(0x858458f6)
|
|
|
+ FsMagicTmpFs = FsMagic(0x01021994)
|
|
|
+ FsMagicSquashFs = FsMagic(0x73717368)
|
|
|
+ FsMagicNfsFs = FsMagic(0x00006969)
|
|
|
+ FsMagicReiserFs = FsMagic(0x52654973)
|
|
|
+ FsMagicSmbFs = FsMagic(0x0000517B)
|
|
|
+ FsMagicJffs2Fs = FsMagic(0x000072b6)
|
|
|
+ FsMagicUnsupported = FsMagic(0x00000000)
|
|
|
+)
|
|
|
+
|
|
|
+var (
|
|
|
+ DefaultDriver string
|
|
|
+ // All registred drivers
|
|
|
+ drivers map[string]InitFunc
|
|
|
+ // Slice of drivers that should be used in an order
|
|
|
+ priority = []string{
|
|
|
+ "aufs",
|
|
|
+ "btrfs",
|
|
|
+ "devicemapper",
|
|
|
+ "vfs",
|
|
|
+ // experimental, has to be enabled manually for now
|
|
|
+ "overlay",
|
|
|
+ }
|
|
|
+
|
|
|
+ ErrNotSupported = errors.New("driver not supported")
|
|
|
+ ErrPrerequisites = errors.New("prerequisites for driver not satisfied (wrong filesystem?)")
|
|
|
+ ErrIncompatibleFS = fmt.Errorf("backing file system is unsupported for this graph driver")
|
|
|
+
|
|
|
+ FsNames = map[FsMagic]string{
|
|
|
+ FsMagicAufs: "aufs",
|
|
|
+ FsMagicBtrfs: "btrfs",
|
|
|
+ FsMagicExtfs: "extfs",
|
|
|
+ FsMagicCramfs: "cramfs",
|
|
|
+ FsMagicRamFs: "ramfs",
|
|
|
+ FsMagicTmpFs: "tmpfs",
|
|
|
+ FsMagicSquashFs: "squashfs",
|
|
|
+ FsMagicNfsFs: "nfs",
|
|
|
+ FsMagicReiserFs: "reiserfs",
|
|
|
+ FsMagicSmbFs: "smb",
|
|
|
+ FsMagicJffs2Fs: "jffs2",
|
|
|
+ FsMagicUnsupported: "unsupported",
|
|
|
+ }
|
|
|
)
|
|
|
|
|
|
type InitFunc func(root string, options []string) (Driver, error)
|
|
@@ -72,25 +116,6 @@ type Driver interface {
|
|
|
DiffSize(id, parent string) (size int64, err error)
|
|
|
}
|
|
|
|
|
|
-var (
|
|
|
- DefaultDriver string
|
|
|
- // All registred drivers
|
|
|
- drivers map[string]InitFunc
|
|
|
- // Slice of drivers that should be used in an order
|
|
|
- priority = []string{
|
|
|
- "aufs",
|
|
|
- "btrfs",
|
|
|
- "devicemapper",
|
|
|
- "vfs",
|
|
|
- // experimental, has to be enabled manually for now
|
|
|
- "overlay",
|
|
|
- }
|
|
|
-
|
|
|
- ErrNotSupported = errors.New("driver not supported")
|
|
|
- ErrPrerequisites = errors.New("prerequisites for driver not satisfied (wrong filesystem?)")
|
|
|
- ErrIncompatibleFS = fmt.Errorf("backing file system is unsupported for this graph driver")
|
|
|
-)
|
|
|
-
|
|
|
func init() {
|
|
|
drivers = make(map[string]InitFunc)
|
|
|
}
|