From ebb413534f4b0cc7451e6e9cbb3fb9745263cbbd Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 3 Dec 2020 14:11:58 +0530 Subject: [PATCH] cephfs: remove unsed cr util.Credentials remove unused cr util.Credentials variable. Signed-off-by: Madhu Rajanna --- internal/cephfs/clone.go | 2 +- internal/cephfs/controllerserver.go | 4 ++-- internal/cephfs/fsjournal.go | 8 +++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/cephfs/clone.go b/internal/cephfs/clone.go index f875fb906..e00c9bf64 100644 --- a/internal/cephfs/clone.go +++ b/internal/cephfs/clone.go @@ -134,7 +134,7 @@ func createCloneFromSubvolume(ctx context.Context, volID, cloneID volumeID, volO return nil } -func cleanupCloneFromSubvolumeSnapshot(ctx context.Context, volID, cloneID volumeID, parentVolOpt *volumeOptions, cr *util.Credentials) error { +func cleanupCloneFromSubvolumeSnapshot(ctx context.Context, volID, cloneID volumeID, parentVolOpt *volumeOptions) error { // snapshot name is same as clone name as we need a name which can be // identified during PVC-PVC cloning. snapShotID := cloneID diff --git a/internal/cephfs/controllerserver.go b/internal/cephfs/controllerserver.go index 11067535c..9d2c11555 100644 --- a/internal/cephfs/controllerserver.go +++ b/internal/cephfs/controllerserver.go @@ -568,7 +568,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS } }() snap := snapshotInfo{} - snap, err = doSnapshot(ctx, parentVolOptions, vid.FsSubvolName, sID.FsSnapshotName, cr) + snap, err = doSnapshot(ctx, parentVolOptions, vid.FsSubvolName, sID.FsSnapshotName) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -583,7 +583,7 @@ func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateS }, nil } -func doSnapshot(ctx context.Context, volOpt *volumeOptions, subvolumeName, snapshotName string, cr *util.Credentials) (snapshotInfo, error) { +func doSnapshot(ctx context.Context, volOpt *volumeOptions, subvolumeName, snapshotName string) (snapshotInfo, error) { volID := volumeID(subvolumeName) snapID := volumeID(snapshotName) snap := snapshotInfo{} diff --git a/internal/cephfs/fsjournal.go b/internal/cephfs/fsjournal.go index 5a3899800..7ba8c8404 100644 --- a/internal/cephfs/fsjournal.go +++ b/internal/cephfs/fsjournal.go @@ -90,8 +90,7 @@ func checkVolExists(ctx context.Context, err = cleanupCloneFromSubvolumeSnapshot( ctx, volumeID(pvID.FsSubvolName), volumeID(vid.FsSubvolName), - parentVolOpt, - cr) + parentVolOpt) if err != nil { return nil, err } @@ -118,8 +117,7 @@ func checkVolExists(ctx context.Context, err = cleanupCloneFromSubvolumeSnapshot( ctx, volumeID(pvID.FsSubvolName), volumeID(vid.FsSubvolName), - parentVolOpt, - cr) + parentVolOpt) if err != nil { return nil, err } @@ -160,7 +158,7 @@ func checkVolExists(ctx context.Context, vid.VolumeID, vid.FsSubvolName, volOptions.RequestName) if parentVolOpt != nil && pvID != nil { - err = cleanupCloneFromSubvolumeSnapshot(ctx, volumeID(pvID.FsSubvolName), volumeID(vid.FsSubvolName), parentVolOpt, cr) + err = cleanupCloneFromSubvolumeSnapshot(ctx, volumeID(pvID.FsSubvolName), volumeID(vid.FsSubvolName), parentVolOpt) if err != nil { return nil, err }