Merge pull request #11871 from NinjaTrappeur/dry-run-test
Fix vet warning in devicemapper.
This commit is contained in:
commit
b1a14e04d6
2 changed files with 6 additions and 5 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
@ -226,7 +227,7 @@ func (t *Task) GetDriverVersion() (string, error) {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Task) GetNextTarget(next uintptr) (nextPtr uintptr, start uint64,
|
func (t *Task) GetNextTarget(next unsafe.Pointer) (nextPtr unsafe.Pointer, start uint64,
|
||||||
length uint64, targetType string, params string) {
|
length uint64, targetType string, params string) {
|
||||||
|
|
||||||
return DmGetNextTarget(t.unmanaged, next, &start, &length,
|
return DmGetNextTarget(t.unmanaged, next, &start, &length,
|
||||||
|
@ -512,7 +513,7 @@ func GetStatus(name string) (uint64, uint64, string, string, error) {
|
||||||
return 0, 0, "", "", fmt.Errorf("Non existing device %s", name)
|
return 0, 0, "", "", fmt.Errorf("Non existing device %s", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, start, length, targetType, params := task.GetNextTarget(0)
|
_, start, length, targetType, params := task.GetNextTarget(unsafe.Pointer(nil))
|
||||||
return start, length, targetType, params, nil
|
return start, length, targetType, params, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ func dmTaskGetDriverVersionFct(task *CDmTask) string {
|
||||||
return C.GoString((*C.char)(buffer))
|
return C.GoString((*C.char)(buffer))
|
||||||
}
|
}
|
||||||
|
|
||||||
func dmGetNextTargetFct(task *CDmTask, next uintptr, start, length *uint64, target, params *string) uintptr {
|
func dmGetNextTargetFct(task *CDmTask, next unsafe.Pointer, start, length *uint64, target, params *string) unsafe.Pointer {
|
||||||
var (
|
var (
|
||||||
Cstart, Clength C.uint64_t
|
Cstart, Clength C.uint64_t
|
||||||
CtargetType, Cparams *C.char
|
CtargetType, Cparams *C.char
|
||||||
|
@ -231,8 +231,8 @@ func dmGetNextTargetFct(task *CDmTask, next uintptr, start, length *uint64, targ
|
||||||
*params = C.GoString(Cparams)
|
*params = C.GoString(Cparams)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
nextp := C.dm_get_next_target((*C.struct_dm_task)(task), unsafe.Pointer(next), &Cstart, &Clength, &CtargetType, &Cparams)
|
nextp := C.dm_get_next_target((*C.struct_dm_task)(task), next, &Cstart, &Clength, &CtargetType, &Cparams)
|
||||||
return uintptr(nextp)
|
return nextp
|
||||||
}
|
}
|
||||||
|
|
||||||
func dmUdevSetSyncSupportFct(syncWithUdev int) {
|
func dmUdevSetSyncSupportFct(syncWithUdev int) {
|
||||||
|
|
Loading…
Reference in a new issue