2013-11-07 07:33:31 -05:00
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
aufs driver directory structure
|
|
|
|
|
|
|
|
|
|
.
|
|
|
|
|
├── layers // Metadata of layers
|
|
|
|
|
│ ├── 1
|
|
|
|
|
│ ├── 2
|
|
|
|
|
│ └── 3
|
|
|
|
|
├── diffs // Content of the layer
|
|
|
|
|
│ ├── 1 // Contains layers that need to be mounted for the id
|
|
|
|
|
│ ├── 2
|
|
|
|
|
│ └── 3
|
|
|
|
|
└── mnt // Mount points for the rw layers to be mounted
|
|
|
|
|
├── 1
|
|
|
|
|
├── 2
|
|
|
|
|
└── 3
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2013-10-31 21:07:54 -04:00
|
|
|
|
package aufs
|
|
|
|
|
|
|
|
|
|
import (
|
2013-11-07 20:57:14 -05:00
|
|
|
|
"bufio"
|
2013-10-31 21:07:54 -04:00
|
|
|
|
"fmt"
|
2013-11-04 23:51:12 -05:00
|
|
|
|
"github.com/dotcloud/docker/archive"
|
2013-11-03 20:54:51 -05:00
|
|
|
|
"github.com/dotcloud/docker/graphdriver"
|
2014-01-20 13:52:26 -05:00
|
|
|
|
mountpk "github.com/dotcloud/docker/pkg/mount"
|
2013-11-07 07:33:31 -05:00
|
|
|
|
"github.com/dotcloud/docker/utils"
|
2013-10-31 21:07:54 -04:00
|
|
|
|
"os"
|
|
|
|
|
"os/exec"
|
|
|
|
|
"path"
|
2013-11-07 20:57:14 -05:00
|
|
|
|
"strings"
|
2014-01-14 06:23:20 -05:00
|
|
|
|
"sync"
|
2013-10-31 21:07:54 -04:00
|
|
|
|
)
|
|
|
|
|
|
2013-11-04 18:22:34 -05:00
|
|
|
|
func init() {
|
|
|
|
|
graphdriver.Register("aufs", Init)
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
type Driver struct {
|
2014-01-14 06:23:20 -05:00
|
|
|
|
root string
|
|
|
|
|
sync.Mutex // Protects concurrent modification to active
|
|
|
|
|
active map[string]int
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-03 20:54:51 -05:00
|
|
|
|
// New returns a new AUFS driver.
|
|
|
|
|
// An error is returned if AUFS is not supported.
|
2013-11-04 18:22:34 -05:00
|
|
|
|
func Init(root string) (graphdriver.Driver, error) {
|
|
|
|
|
// Try to load the aufs kernel module
|
2013-11-07 20:57:14 -05:00
|
|
|
|
if err := supportsAufs(); err != nil {
|
2013-11-04 18:22:34 -05:00
|
|
|
|
return nil, err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
paths := []string{
|
|
|
|
|
"mnt",
|
|
|
|
|
"diff",
|
|
|
|
|
"layers",
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-14 06:23:20 -05:00
|
|
|
|
a := &Driver{
|
|
|
|
|
root: root,
|
|
|
|
|
active: make(map[string]int),
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Create the root aufs driver dir and return
|
|
|
|
|
// if it already exists
|
|
|
|
|
// If not populate the dir structure
|
2013-11-08 14:36:58 -05:00
|
|
|
|
if err := os.MkdirAll(root, 0755); err != nil {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
if os.IsExist(err) {
|
2014-01-14 06:23:20 -05:00
|
|
|
|
return a, nil
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, p := range paths {
|
2013-11-08 14:36:58 -05:00
|
|
|
|
if err := os.MkdirAll(path.Join(root, p), 0755); err != nil {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-01-14 06:23:20 -05:00
|
|
|
|
return a, nil
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 20:57:14 -05:00
|
|
|
|
// Return a nil error if the kernel supports aufs
|
|
|
|
|
// We cannot modprobe because inside dind modprobe fails
|
|
|
|
|
// to run
|
|
|
|
|
func supportsAufs() error {
|
2013-11-14 12:42:12 -05:00
|
|
|
|
// We can try to modprobe aufs first before looking at
|
|
|
|
|
// proc/filesystems for when aufs is supported
|
|
|
|
|
exec.Command("modprobe", "aufs").Run()
|
|
|
|
|
|
2013-11-07 20:57:14 -05:00
|
|
|
|
f, err := os.Open("/proc/filesystems")
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
defer f.Close()
|
|
|
|
|
|
|
|
|
|
s := bufio.NewScanner(f)
|
|
|
|
|
for s.Scan() {
|
|
|
|
|
if strings.Contains(s.Text(), "aufs") {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return fmt.Errorf("AUFS was not found in /proc/filesystems")
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a Driver) rootPath() string {
|
2013-11-08 14:36:58 -05:00
|
|
|
|
return a.root
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (Driver) String() string {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return "aufs"
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-20 16:53:54 -05:00
|
|
|
|
func (a Driver) Status() [][2]string {
|
|
|
|
|
ids, _ := loadIds(path.Join(a.rootPath(), "layers"))
|
|
|
|
|
return [][2]string{
|
|
|
|
|
{"Root Dir", a.rootPath()},
|
|
|
|
|
{"Dirs", fmt.Sprintf("%d", len(ids))},
|
|
|
|
|
}
|
2013-11-15 05:04:02 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-18 20:20:03 -05:00
|
|
|
|
// Exists returns true if the given id is registered with
|
|
|
|
|
// this driver
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a Driver) Exists(id string) bool {
|
2013-11-19 02:28:45 -05:00
|
|
|
|
if _, err := os.Lstat(path.Join(a.rootPath(), "layers", id)); err != nil {
|
2013-11-15 20:16:30 -05:00
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Three folders are created for each id
|
|
|
|
|
// mnt, layers, and diff
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) Create(id, parent string) error {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
if err := a.createDirsFor(id); err != nil {
|
2013-11-04 23:51:12 -05:00
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Write the layers metadata
|
|
|
|
|
f, err := os.Create(path.Join(a.rootPath(), "layers", id))
|
|
|
|
|
if err != nil {
|
2013-11-04 23:51:12 -05:00
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
defer f.Close()
|
2013-11-04 23:51:12 -05:00
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
if parent != "" {
|
|
|
|
|
ids, err := getParentIds(a.rootPath(), parent)
|
|
|
|
|
if err != nil {
|
2013-11-04 23:51:12 -05:00
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-08 14:10:33 -05:00
|
|
|
|
if _, err := fmt.Fprintln(f, parent); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
for _, i := range ids {
|
2013-11-08 14:10:33 -05:00
|
|
|
|
if _, err := fmt.Fprintln(f, i); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
2013-11-04 23:51:12 -05:00
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) createDirsFor(id string) error {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
paths := []string{
|
|
|
|
|
"mnt",
|
|
|
|
|
"diff",
|
|
|
|
|
}
|
2013-11-04 23:51:12 -05:00
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
for _, p := range paths {
|
2013-11-11 17:30:38 -05:00
|
|
|
|
if err := os.MkdirAll(path.Join(a.rootPath(), p, id), 0755); err != nil {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-04 23:51:12 -05:00
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return nil
|
|
|
|
|
}
|
2013-11-04 23:51:12 -05:00
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Unmount and remove the dir information
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) Remove(id string) error {
|
2014-01-14 06:23:20 -05:00
|
|
|
|
// Protect the a.active from concurrent access
|
|
|
|
|
a.Lock()
|
|
|
|
|
defer a.Unlock()
|
|
|
|
|
|
|
|
|
|
if a.active[id] != 0 {
|
|
|
|
|
utils.Errorf("Warning: removing active id %s\n", id)
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Make sure the dir is umounted first
|
2013-11-08 13:17:51 -05:00
|
|
|
|
if err := a.unmount(id); err != nil {
|
2013-11-04 23:51:12 -05:00
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
tmpDirs := []string{
|
|
|
|
|
"mnt",
|
|
|
|
|
"diff",
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-27 13:07:30 -05:00
|
|
|
|
// Atomically remove each directory in turn by first moving it out of the
|
|
|
|
|
// way (so that docker doesn't find it anymore) before doing removal of
|
|
|
|
|
// the whole tree.
|
2013-11-07 07:33:31 -05:00
|
|
|
|
for _, p := range tmpDirs {
|
2014-01-27 13:07:30 -05:00
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
realPath := path.Join(a.rootPath(), p, id)
|
2014-01-27 13:07:30 -05:00
|
|
|
|
tmpPath := path.Join(a.rootPath(), p, fmt.Sprintf("%s-removing", id))
|
|
|
|
|
if err := os.Rename(realPath, tmpPath); err != nil && !os.IsNotExist(err) {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return err
|
|
|
|
|
}
|
2014-01-27 13:07:30 -05:00
|
|
|
|
defer os.RemoveAll(tmpPath)
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove the layers file for the id
|
2013-11-19 20:08:21 -05:00
|
|
|
|
if err := os.Remove(path.Join(a.rootPath(), "layers", id)); err != nil && !os.IsNotExist(err) {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
2013-11-04 23:51:12 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Return the rootfs path for the id
|
|
|
|
|
// This will mount the dir at it's given path
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) Get(id string) (string, error) {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
ids, err := getParentIds(a.rootPath(), id)
|
2013-10-31 21:07:54 -04:00
|
|
|
|
if err != nil {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
if !os.IsNotExist(err) {
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
|
|
|
|
ids = []string{}
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|
|
|
|
|
|
2014-01-14 06:23:20 -05:00
|
|
|
|
// Protect the a.active from concurrent access
|
|
|
|
|
a.Lock()
|
|
|
|
|
defer a.Unlock()
|
|
|
|
|
|
|
|
|
|
count := a.active[id]
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// If a dir does not have a parent ( no layers )do not try to mount
|
|
|
|
|
// just return the diff path to the data
|
|
|
|
|
out := path.Join(a.rootPath(), "diff", id)
|
|
|
|
|
if len(ids) > 0 {
|
|
|
|
|
out = path.Join(a.rootPath(), "mnt", id)
|
2014-01-14 06:23:20 -05:00
|
|
|
|
|
|
|
|
|
if count == 0 {
|
|
|
|
|
if err := a.mount(id); err != nil {
|
|
|
|
|
return "", err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-01-14 06:23:20 -05:00
|
|
|
|
|
|
|
|
|
a.active[id] = count + 1
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return out, nil
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-05 16:18:02 -05:00
|
|
|
|
func (a *Driver) Put(id string) {
|
2014-01-14 06:23:20 -05:00
|
|
|
|
// Protect the a.active from concurrent access
|
|
|
|
|
a.Lock()
|
|
|
|
|
defer a.Unlock()
|
|
|
|
|
|
|
|
|
|
if count := a.active[id]; count > 1 {
|
|
|
|
|
a.active[id] = count - 1
|
|
|
|
|
} else {
|
|
|
|
|
ids, _ := getParentIds(a.rootPath(), id)
|
|
|
|
|
// We only mounted if there are any parents
|
|
|
|
|
if ids != nil && len(ids) > 0 {
|
|
|
|
|
a.unmount(id)
|
|
|
|
|
}
|
|
|
|
|
delete(a.active, id)
|
|
|
|
|
}
|
2013-12-05 16:18:02 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Returns an archive of the contents for the id
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) Diff(id string) (archive.Archive, error) {
|
2013-11-11 20:17:38 -05:00
|
|
|
|
return archive.TarFilter(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
|
|
|
|
|
Compression: archive.Uncompressed,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-14 06:41:46 -05:00
|
|
|
|
func (a *Driver) ApplyDiff(id string, diff archive.ArchiveReader) error {
|
2013-11-11 20:17:38 -05:00
|
|
|
|
return archive.Untar(diff, path.Join(a.rootPath(), "diff", id), nil)
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
2013-10-31 21:07:54 -04:00
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// Returns the size of the contents for the id
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) DiffSize(id string) (int64, error) {
|
2013-11-11 15:09:26 -05:00
|
|
|
|
return utils.TreeSize(path.Join(a.rootPath(), "diff", id))
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) Changes(id string) ([]archive.Change, error) {
|
2013-11-08 14:10:33 -05:00
|
|
|
|
layers, err := a.getParentLayerPaths(id)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return archive.Changes(layers, path.Join(a.rootPath(), "diff", id))
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) getParentLayerPaths(id string) ([]string, error) {
|
2013-11-08 14:10:33 -05:00
|
|
|
|
parentIds, err := getParentIds(a.rootPath(), id)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
if len(parentIds) == 0 {
|
|
|
|
|
return nil, fmt.Errorf("Dir %s does not have any parent layers", id)
|
|
|
|
|
}
|
|
|
|
|
layers := make([]string, len(parentIds))
|
|
|
|
|
|
|
|
|
|
// Get the diff paths for all the parent ids
|
|
|
|
|
for i, p := range parentIds {
|
|
|
|
|
layers[i] = path.Join(a.rootPath(), "diff", p)
|
|
|
|
|
}
|
|
|
|
|
return layers, nil
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) mount(id string) error {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// If the id is mounted or we get an error return
|
|
|
|
|
if mounted, err := a.mounted(id); err != nil || mounted {
|
2013-10-31 21:07:54 -04:00
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
target = path.Join(a.rootPath(), "mnt", id)
|
|
|
|
|
rw = path.Join(a.rootPath(), "diff", id)
|
|
|
|
|
)
|
|
|
|
|
|
2013-11-08 14:10:33 -05:00
|
|
|
|
layers, err := a.getParentLayerPaths(id)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
2013-11-07 07:33:31 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-10-31 21:07:54 -04:00
|
|
|
|
if err := a.aufsMount(layers, rw, target); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) unmount(id string) error {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
if mounted, err := a.mounted(id); err != nil || !mounted {
|
2013-10-31 21:07:54 -04:00
|
|
|
|
return err
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
target := path.Join(a.rootPath(), "mnt", id)
|
2013-10-31 21:07:54 -04:00
|
|
|
|
return Unmount(target)
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) mounted(id string) (bool, error) {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
target := path.Join(a.rootPath(), "mnt", id)
|
2013-12-18 19:42:49 -05:00
|
|
|
|
return mountpk.Mounted(target)
|
2013-11-04 23:51:12 -05:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-07 07:33:31 -05:00
|
|
|
|
// During cleanup aufs needs to unmount all mountpoints
|
2013-11-19 06:27:59 -05:00
|
|
|
|
func (a *Driver) Cleanup() error {
|
2013-11-07 07:33:31 -05:00
|
|
|
|
ids, err := loadIds(path.Join(a.rootPath(), "layers"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
for _, id := range ids {
|
|
|
|
|
if err := a.unmount(id); err != nil {
|
2013-11-19 20:08:21 -05:00
|
|
|
|
utils.Errorf("Unmounting %s: %s", utils.TruncateID(id), err)
|
2013-11-04 23:51:12 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-11-07 07:33:31 -05:00
|
|
|
|
return nil
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-26 13:50:53 -05:00
|
|
|
|
func (a *Driver) aufsMount(ro []string, rw, target string) (err error) {
|
|
|
|
|
defer func() {
|
|
|
|
|
if err != nil {
|
|
|
|
|
Unmount(target)
|
|
|
|
|
}
|
|
|
|
|
}()
|
2013-10-31 21:07:54 -04:00
|
|
|
|
|
2013-11-26 13:50:53 -05:00
|
|
|
|
if err = a.tryMount(ro, rw, target); err != nil {
|
|
|
|
|
if err = a.mountRw(rw, target); err != nil {
|
|
|
|
|
return
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|
2013-11-26 13:50:53 -05:00
|
|
|
|
|
|
|
|
|
for _, layer := range ro {
|
|
|
|
|
branch := fmt.Sprintf("append:%s=ro+wh", layer)
|
2013-12-18 13:18:49 -05:00
|
|
|
|
if err = mount("none", target, "aufs", MsRemount, branch); err != nil {
|
2013-11-26 13:50:53 -05:00
|
|
|
|
return
|
|
|
|
|
}
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-11-26 13:50:53 -05:00
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Try to mount using the aufs fast path, if this fails then
|
|
|
|
|
// append ro layers.
|
|
|
|
|
func (a *Driver) tryMount(ro []string, rw, target string) (err error) {
|
|
|
|
|
var (
|
|
|
|
|
rwBranch = fmt.Sprintf("%s=rw", rw)
|
|
|
|
|
roBranches = fmt.Sprintf("%s=ro+wh:", strings.Join(ro, "=ro+wh:"))
|
|
|
|
|
)
|
|
|
|
|
return mount("none", target, "aufs", 0, fmt.Sprintf("br:%v:%v,xino=/dev/shm/aufs.xino", rwBranch, roBranches))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *Driver) mountRw(rw, target string) error {
|
|
|
|
|
return mount("none", target, "aufs", 0, fmt.Sprintf("br:%s,xino=/dev/shm/aufs.xino", rw))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func rollbackMount(target string, err error) {
|
|
|
|
|
if err != nil {
|
|
|
|
|
Unmount(target)
|
|
|
|
|
}
|
2013-10-31 21:07:54 -04:00
|
|
|
|
}
|