64ffdbc701
A lot of time device mapper devices leak across mount namespace which docker does not know about and when docker tries to deactivate/delete device, operation fails as device is open in some mount namespace. Create a mechanism where one can defer the device deactivation/deletion so that docker operation does not fail and device automatically goes away when last reference to it is dropped. Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
15 lines
301 B
Go
15 lines
301 B
Go
// +build linux,!libdm_no_deferred_remove
|
|
|
|
package devicemapper
|
|
|
|
/*
|
|
#cgo LDFLAGS: -L. -ldevmapper
|
|
#include <libdevmapper.h>
|
|
*/
|
|
import "C"
|
|
|
|
const LibraryDeferredRemovalSupport = true
|
|
|
|
func dmTaskDeferredRemoveFct(task *CDmTask) int {
|
|
return int(C.dm_task_deferred_remove((*C.struct_dm_task)(task)))
|
|
}
|