Skip to content

Commit 1dc032e

Browse files
Yuggupta27mergify[bot]
authored andcommitted
doc: update comments in voljournal
Update spell errors and comments in voljournal.go Signed-off-by: Yug Gupta <yuggupta27@gmail.com>
1 parent 4859f2d commit 1dc032e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

internal/journal/voljournal.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func (conn *Connection) CheckReservation(ctx context.Context,
310310
}
311311
objUUIDAndPool, found := values[cj.csiNameKeyPrefix+reqName]
312312
if !found {
313-
// oamp was read but was missing the desired key-value pair
313+
// omap was read but was missing the desired key-value pair
314314
// stop processing but without an error for no reservation exists
315315
return nil, nil
316316
}
@@ -459,9 +459,9 @@ func (conn *Connection) UndoReservation(ctx context.Context,
459459
// reserveOMapName creates an omap with passed in oMapNamePrefix and a
460460
// generated <uuid>. If the passed volUUID is not empty it will use it instead
461461
// of generating its own UUID and it will return an error immediately if omap
462-
// already exists.if the passed volUUID is empty It ensures generated omap name
462+
// already exists. If the passed volUUID is empty, it ensures generated omap name
463463
// does not already exist and if conflicts are detected, a set number of
464-
// retires with newer uuids are attempted before returning an error.
464+
// retries with newer uuids are attempted before returning an error.
465465
func reserveOMapName(
466466
ctx context.Context,
467467
monitors string,
@@ -482,7 +482,7 @@ func reserveOMapName(
482482
err := util.CreateObject(ctx, monitors, cr, pool, namespace, oMapNamePrefix+iterUUID)
483483
if err != nil {
484484
// if the volUUID is empty continue with retry as consumer of this
485-
// function doesn't requested to create object with specific value.
485+
// function didn't request to create object with specific value.
486486
if volUUID == "" && errors.Is(err, util.ErrObjectExists) {
487487
attempt++
488488
// try again with a different uuid, for maxAttempts tries
@@ -514,16 +514,15 @@ held, to prevent parallel operations from modifying the state of the omaps for t
514514
515515
Input arguments:
516516
- journalPool: Pool where the CSI journal is stored (maybe different than the pool where the
517-
image/subvolume is created duw to topology constraints)
517+
image/subvolume is created due to topology constraints)
518518
- journalPoolID: pool ID of the journalPool
519519
- imagePool: Pool where the image/subvolume is created
520520
- imagePoolID: pool ID of the imagePool
521521
- reqName: Name of the volume request received
522-
- namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-genetated UUID)
522+
- namePrefix: Prefix to use when generating the image/subvolume name (suffix is an auto-generated UUID)
523523
- parentName: Name of the parent image/subvolume if reservation is for a snapshot (optional)
524524
- kmsConf: Name of the key management service used to encrypt the image (optional)
525-
- volUUID: UUID need to be reserved instead of auto-generating one (this is
526-
useful for mirroring and metro-DR)
525+
- volUUID: UUID need to be reserved instead of auto-generating one (this is useful for mirroring and metro-DR)
527526
- owner: the owner of the volume (optional)
528527
529528
Return values:
@@ -581,6 +580,9 @@ func (conn *Connection) ReserveName(ctx context.Context,
581580
nameKeyVal = volUUID
582581
}
583582

583+
// After generating the UUID Directory omap, we populate the csiDirectory
584+
// omap with a key-value entry to map the request to the backend volume:
585+
// `csiNameKeyPrefix + reqName: nameKeyVal`
584586
err = setOMapKeys(ctx, conn, journalPool, cj.namespace, cj.csiDirectory,
585587
map[string]string{cj.csiNameKeyPrefix + reqName: nameKeyVal})
586588
if err != nil {

0 commit comments

Comments
 (0)