Beispiel #1
0
// Put releases the system resources for the specified id,
// e.g, unmounting layered filesystem.
func (d *Driver) Put(id string) error {
	dlog.Debugf("Releasing chain FS for %s", id)

	cID := C.CString(id)
	_, err := C.release_chainfs(cID)

	// C.release_cache()

	return err
}
Beispiel #2
0
// Get returns the mountpoint for the layered filesystem referred
// to by this id. You can optionally specify a mountLabel or "".
// Returns the absolute path to the mounted layered filesystem.
func (d *Driver) Get(id, mountLabel string) (string, error) {
	cID := C.CString(id)

	ret, err := C.alloc_chainfs(cID)
	if int(ret) != 0 {
		dlog.Warnf("Error while creating a chain FS for %s", id)
		return "", err
	} else {
		dlog.Debugf("Created a chain FS for %s", id)
		chainPath := path.Join(virtPath, id)
		return chainPath, err
	}
}
Beispiel #3
0
// Shutdown and cleanup.
func (d *driver) Shutdown() {
	dlog.Debugf("%s Shutting down", Name)
}