rbd: remove unneeded updateVolWithImageInfo()

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-05-08 16:14:05 +02:00 committed by mergify[bot]
parent 824f38daaa
commit 3364fe7b78
2 changed files with 2 additions and 8 deletions

View File

@ -214,7 +214,7 @@ func (rv *rbdVolume) Exists(ctx context.Context) (bool, error) {
// save it for size checks before fetching image data
requestSize := rv.VolSize
// Fetch on-disk image attributes and compare against request
err = updateVolWithImageInfo(ctx, rv, rv.conn.Creds)
err = rv.getImageInfo()
if err != nil {
if _, ok := err.(ErrImageNotFound); ok {
err = j.UndoReservation(ctx, rv.JournalPool, rv.Pool,

View File

@ -377,12 +377,6 @@ func updateSnapWithImageInfo(ctx context.Context, rbdSnap *rbdSnapshot, cr *util
return err
}
// updateVolWithImageInfo updates provided rbdVolume with information from on-disk data
// regarding the same
func updateVolWithImageInfo(ctx context.Context, rbdVol *rbdVolume, cr *util.Credentials) error {
return rbdVol.getImageInfo()
}
// genSnapFromSnapID generates a rbdSnapshot structure from the provided identifier, updating
// the structure with elements from on-disk snapshot metadata as well
func genSnapFromSnapID(ctx context.Context, rbdSnap *rbdSnapshot, snapshotID string, cr *util.Credentials) error {
@ -513,7 +507,7 @@ func genVolFromVolID(ctx context.Context, volumeID string, cr *util.Credentials,
}
}
err = updateVolWithImageInfo(ctx, rbdVol, cr)
err = rbdVol.getImageInfo()
return rbdVol, err
}