github.com/torfuzx/docker@v1.8.1/pkg/devicemapper/devmapper_wrapper_deferred_remove.go (about)

     1  // +build linux,!libdm_no_deferred_remove
     2  
     3  package devicemapper
     4  
     5  /*
     6  #cgo LDFLAGS: -L. -ldevmapper
     7  #include <libdevmapper.h>
     8  */
     9  import "C"
    10  
    11  const LibraryDeferredRemovalSupport = true
    12  
    13  func dmTaskDeferredRemoveFct(task *CDmTask) int {
    14  	return int(C.dm_task_deferred_remove((*C.struct_dm_task)(task)))
    15  }
    16  
    17  func dmTaskGetInfoWithDeferredFct(task *CDmTask, info *Info) int {
    18  	Cinfo := C.struct_dm_info{}
    19  	defer func() {
    20  		info.Exists = int(Cinfo.exists)
    21  		info.Suspended = int(Cinfo.suspended)
    22  		info.LiveTable = int(Cinfo.live_table)
    23  		info.InactiveTable = int(Cinfo.inactive_table)
    24  		info.OpenCount = int32(Cinfo.open_count)
    25  		info.EventNr = uint32(Cinfo.event_nr)
    26  		info.Major = uint32(Cinfo.major)
    27  		info.Minor = uint32(Cinfo.minor)
    28  		info.ReadOnly = int(Cinfo.read_only)
    29  		info.TargetCount = int32(Cinfo.target_count)
    30  		info.DeferredRemove = int(Cinfo.deferred_remove)
    31  	}()
    32  	return int(C.dm_task_get_info((*C.struct_dm_task)(task), &Cinfo))
    33  }