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 <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-07-25 14:40:39 -04:00 committed by John Mulligan
parent aa29fad715
commit d6e928993b
1 changed files with 7 additions and 7 deletions

View File

@ -85,7 +85,7 @@ var watchCallbacks = callbacks.New()
// callback. // callback.
type WatchCallback func(interface{}) type WatchCallback func(interface{})
type watchInstance struct { type watchCallbackCtx struct {
callback WatchCallback callback WatchCallback
data interface{} data interface{}
} }
@ -93,7 +93,7 @@ type watchInstance struct {
// Watch represents an ongoing image metadata watch. // Watch represents an ongoing image metadata watch.
type Watch struct { type Watch struct {
image *Image image *Image
wi watchInstance wcc watchCallbackCtx
handle C.uint64_t handle C.uint64_t
cbIndex int cbIndex int
} }
@ -108,14 +108,14 @@ func (image *Image) UpdateWatch(cb WatchCallback, data interface{}) (*Watch, err
if err := image.validate(imageIsOpen); err != nil { if err := image.validate(imageIsOpen); err != nil {
return nil, err return nil, err
} }
wi := watchInstance{ wcc := watchCallbackCtx{
callback: cb, callback: cb,
data: data, data: data,
} }
w := &Watch{ w := &Watch{
image: image, image: image,
wi: wi, wcc: wcc,
cbIndex: watchCallbacks.Add(wi), cbIndex: watchCallbacks.Add(wcc),
} }
ret := C.wrap_rbd_update_watch( ret := C.wrap_rbd_update_watch(
@ -147,6 +147,6 @@ func (w *Watch) Unwatch() error {
//export imageWatchCallback //export imageWatchCallback
func imageWatchCallback(index unsafe.Pointer) { func imageWatchCallback(index unsafe.Pointer) {
v := watchCallbacks.Lookup(int(uintptr(index))) v := watchCallbacks.Lookup(int(uintptr(index)))
wi := v.(watchInstance) wcc := v.(watchCallbackCtx)
wi.callback(wi.data) wcc.callback(wcc.data)
} }