mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
c77697a45c
This separates out the DeviceSet logic a bit better from the raw device mapper operations. devicemapper: Serialize addess to the devicemapper deviceset This code is not safe to run in multiple threads at the same time, and neither is libdevmapper. DeviceMapper: Move deactivate into UnmountDevice This way the deactivate is atomic wrt othe device mapper operations and will not fail with EBUSY if someone else starts a devicemapper operation inbetween unmount and deactivate. devmapper: Fix loopback mounting regression Some changes were added to attach_loop_device which added a perror() in a place that caused it to override errno so that a later errno != EBUSY failed. This fixes that and cleans up the error reporting a bit. devmapper: Build on old kernels without LOOP_CTL_GET_FREE define
14 lines
410 B
Go
14 lines
410 B
Go
package docker
|
|
|
|
type DeviceSet interface {
|
|
AddDevice(hash, baseHash string) error
|
|
SetInitialized(hash string) error
|
|
DeactivateDevice(hash string) error
|
|
RemoveDevice(hash string) error
|
|
MountDevice(hash, path string) error
|
|
UnmountDevice(hash, path string, deactivate bool) error
|
|
HasDevice(hash string) bool
|
|
HasInitializedDevice(hash string) bool
|
|
HasActivatedDevice(hash string) bool
|
|
Shutdown() error
|
|
}
|