mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-01-05 11:39:29 +00:00
cleanup: passing pointers to larger type
Log: internal/rbd/rbd_attach.go:424:2: hugeParam: dArgs is heavy (88 bytes); consider passing it by pointer (gocritic) Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
parent
ad2c6d2851
commit
10bbb049f7
@ -847,7 +847,7 @@ func (ns *NodeServer) NodeUnstageVolume(
|
|||||||
unmapOptions: imgInfo.UnmapOptions,
|
unmapOptions: imgInfo.UnmapOptions,
|
||||||
logDir: imgInfo.LogDir,
|
logDir: imgInfo.LogDir,
|
||||||
}
|
}
|
||||||
if err = detachRBDImageOrDeviceSpec(ctx, dArgs); err != nil {
|
if err = detachRBDImageOrDeviceSpec(ctx, &dArgs); err != nil {
|
||||||
log.ErrorLog(
|
log.ErrorLog(
|
||||||
ctx,
|
ctx,
|
||||||
"error unmapping volume (%s) from staging path (%s): (%v)",
|
"error unmapping volume (%s) from staging path (%s): (%v)",
|
||||||
|
@ -384,7 +384,7 @@ func createPath(ctx context.Context, volOpt *rbdVolume, device string, cr *util.
|
|||||||
unmapOptions: volOpt.UnmapOptions,
|
unmapOptions: volOpt.UnmapOptions,
|
||||||
logDir: volOpt.LogDir,
|
logDir: volOpt.LogDir,
|
||||||
}
|
}
|
||||||
detErr := detachRBDImageOrDeviceSpec(ctx, dArgs)
|
detErr := detachRBDImageOrDeviceSpec(ctx, &dArgs)
|
||||||
if detErr != nil {
|
if detErr != nil {
|
||||||
log.WarningLog(ctx, "rbd: %s unmap error %v", imagePath, detErr)
|
log.WarningLog(ctx, "rbd: %s unmap error %v", imagePath, detErr)
|
||||||
}
|
}
|
||||||
@ -436,14 +436,14 @@ func detachRBDDevice(ctx context.Context, devicePath, volumeID, unmapOptions str
|
|||||||
unmapOptions: unmapOptions,
|
unmapOptions: unmapOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
return detachRBDImageOrDeviceSpec(ctx, dArgs)
|
return detachRBDImageOrDeviceSpec(ctx, &dArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// detachRBDImageOrDeviceSpec detaches an rbd imageSpec or devicePath, with additional checking
|
// detachRBDImageOrDeviceSpec detaches an rbd imageSpec or devicePath, with additional checking
|
||||||
// when imageSpec is used to decide if image is already unmapped.
|
// when imageSpec is used to decide if image is already unmapped.
|
||||||
func detachRBDImageOrDeviceSpec(
|
func detachRBDImageOrDeviceSpec(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
dArgs detachRBDImageArgs) error {
|
dArgs *detachRBDImageArgs) error {
|
||||||
if dArgs.encrypted {
|
if dArgs.encrypted {
|
||||||
mapperFile, mapperPath := util.VolumeMapper(dArgs.volumeID)
|
mapperFile, mapperPath := util.VolumeMapper(dArgs.volumeID)
|
||||||
mappedDevice, mapper, err := util.DeviceEncryptionStatus(ctx, mapperPath)
|
mappedDevice, mapper, err := util.DeviceEncryptionStatus(ctx, mapperPath)
|
||||||
|
Loading…
Reference in New Issue
Block a user