devicemapper: Add helper functions to allow deferred device removal

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>
Upstream-commit: 6964ab94befd8723585556e560219e0eef48a488
Component: engine
This commit is contained in:
Vivek Goyal
2015-04-21 18:14:59 -04:00
parent d1b60e7633
commit 2651813036
4 changed files with 46 additions and 0 deletions

View File

@ -112,6 +112,7 @@ var (
DmUdevGetSyncSupport = dmUdevGetSyncSupportFct
DmCookieSupported = dmCookieSupportedFct
LogWithErrnoInit = logWithErrnoInitFct
DmTaskDeferredRemove = dmTaskDeferredRemoveFct
)
func free(p *C.char) {