From d6e928993bb14a46dd92012f4393ac28ae5ad6e2 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sat, 25 Jul 2020 14:40:39 -0400 Subject: [PATCH] rbd: fix naming of internal watch callback item type This patch changes the name to the as-agreed-upon naming from a call. I forgot to fix this in the original patches before merging things. Oops. Signed-off-by: John Mulligan --- rbd/watchers_mimic.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rbd/watchers_mimic.go b/rbd/watchers_mimic.go index 7e2de49..e8c8978 100644 --- a/rbd/watchers_mimic.go +++ b/rbd/watchers_mimic.go @@ -85,7 +85,7 @@ var watchCallbacks = callbacks.New() // callback. type WatchCallback func(interface{}) -type watchInstance struct { +type watchCallbackCtx struct { callback WatchCallback data interface{} } @@ -93,7 +93,7 @@ type watchInstance struct { // Watch represents an ongoing image metadata watch. type Watch struct { image *Image - wi watchInstance + wcc watchCallbackCtx handle C.uint64_t cbIndex int } @@ -108,14 +108,14 @@ func (image *Image) UpdateWatch(cb WatchCallback, data interface{}) (*Watch, err if err := image.validate(imageIsOpen); err != nil { return nil, err } - wi := watchInstance{ + wcc := watchCallbackCtx{ callback: cb, data: data, } w := &Watch{ image: image, - wi: wi, - cbIndex: watchCallbacks.Add(wi), + wcc: wcc, + cbIndex: watchCallbacks.Add(wcc), } ret := C.wrap_rbd_update_watch( @@ -147,6 +147,6 @@ func (w *Watch) Unwatch() error { //export imageWatchCallback func imageWatchCallback(index unsafe.Pointer) { v := watchCallbacks.Lookup(int(uintptr(index))) - wi := v.(watchInstance) - wi.callback(wi.data) + wcc := v.(watchCallbackCtx) + wcc.callback(wcc.data) }