Skip to content

Commit b67c94a

Browse files
alexlarssonGuillaume J. Charmes
authored andcommitted
devmapper: Move all "raw" libdevmapper wrappers to devmapper.go
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
1 parent ea5b19c commit b67c94a

File tree

5 files changed

+345
-306
lines changed

5 files changed

+345
-306
lines changed

deviceset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type DeviceSet interface {
66
DeactivateDevice(hash string) error
77
RemoveDevice(hash string) error
88
MountDevice(hash, path string) error
9-
UnmountDevice(hash, path string) error
9+
UnmountDevice(hash, path string, deactivate bool) error
1010
HasDevice(hash string) bool
1111
HasInitializedDevice(hash string) bool
1212
HasActivatedDevice(hash string) bool

0 commit comments

Comments
 (0)