mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +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,
|
||||
logDir: imgInfo.LogDir,
|
||||
}
|
||||
if err = detachRBDImageOrDeviceSpec(ctx, dArgs); err != nil {
|
||||
if err = detachRBDImageOrDeviceSpec(ctx, &dArgs); err != nil {
|
||||
log.ErrorLog(
|
||||
ctx,
|
||||
"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,
|
||||
logDir: volOpt.LogDir,
|
||||
}
|
||||
detErr := detachRBDImageOrDeviceSpec(ctx, dArgs)
|
||||
detErr := detachRBDImageOrDeviceSpec(ctx, &dArgs)
|
||||
if detErr != nil {
|
||||
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,
|
||||
}
|
||||
|
||||
return detachRBDImageOrDeviceSpec(ctx, dArgs)
|
||||
return detachRBDImageOrDeviceSpec(ctx, &dArgs)
|
||||
}
|
||||
|
||||
// detachRBDImageOrDeviceSpec detaches an rbd imageSpec or devicePath, with additional checking
|
||||
// when imageSpec is used to decide if image is already unmapped.
|
||||
func detachRBDImageOrDeviceSpec(
|
||||
ctx context.Context,
|
||||
dArgs detachRBDImageArgs) error {
|
||||
dArgs *detachRBDImageArgs) error {
|
||||
if dArgs.encrypted {
|
||||
mapperFile, mapperPath := util.VolumeMapper(dArgs.volumeID)
|
||||
mappedDevice, mapper, err := util.DeviceEncryptionStatus(ctx, mapperPath)
|
||||
|
Loading…
Reference in New Issue
Block a user