From 805f10fd7199ddf2ce457304c45f431753772090 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 6 Apr 2020 08:55:50 +0200 Subject: [PATCH] rbd: remove unused rbdVolume.open() rbdVolume.open() was split from commit 5dd34732e1e while moving part of the functionality to util.ClusterConnection. It seems that .open() is not used anywhere at the moment, so drop it until follow-up patches require it again. Signed-off-by: Niels de Vos --- internal/rbd/rbd_util.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index c4363cfd8..6f8252922 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -197,30 +197,6 @@ func createImage(ctx context.Context, pOpts *rbdVolume, cr *util.Credentials) er return nil } -// Open the rbdVolume after it has been connected. -func (rv *rbdVolume) open() (*librbd.Image, error) { - if rv.RbdImageName == "" { - var vi util.CSIIdentifier - err := vi.DecomposeCSIID(rv.VolID) - if err != nil { - err = fmt.Errorf("error decoding volume ID (%s) (%s)", rv.VolID, err) - return nil, ErrInvalidVolID{err} - } - rv.RbdImageName = volJournal.GetNameForUUID(rv.NamePrefix, vi.ObjectUUID, false) - } - - ioctx, err := rv.conn.GetIoctx(rv.Pool) - if err != nil { - return nil, err - } - - image, err := librbd.OpenImage(ioctx, rv.RbdImageName, librbd.NoSnapshot) - if err != nil { - return nil, err - } - return image, nil -} - // rbdStatus checks if there is watcher on the image. // It returns true if there is a watcher on the image, otherwise returns false. func rbdStatus(ctx context.Context, pOpts *rbdVolume, cr *util.Credentials) (bool, string, error) {