rbd: improve doc comment style for locking functions
@@ -739,6 +739,9 @@ func (image *Image) ListChildren() (pools []string, images []string, err error)
return pools, images, nil
}
+// ListLockers returns a list of clients that have locks on the image.
+//
+// Impelemnts:
// ssize_t rbd_list_lockers(rbd_image_t image, int *exclusive,
// char *tag, size_t *tag_len,
// char *clients, size_t *clients_len,
@@ -800,6 +803,9 @@ func (image *Image) ListLockers() (tag string, lockers []Locker, err error) {
return string(tag_buf), lockers, nil
}
+// LockExclusive acquires an exclusive lock on the rbd image.
+//
+// Implements:
// int rbd_lock_exclusive(rbd_image_t image, const char *cookie);
func (image *Image) LockExclusive(cookie string) error {
if err := image.validate(imageIsOpen); err != nil {
@@ -812,6 +818,9 @@ func (image *Image) LockExclusive(cookie string) error {
return GetError(C.rbd_lock_exclusive(image.image, c_cookie))
}
+// LockShared acquires a shared lock on the rbd image.
+//
+// Implements:
// int rbd_lock_shared(rbd_image_t image, const char *cookie, const char *tag);
func (image *Image) LockShared(cookie string, tag string) error {
if err := image.validate(imageIsOpen); err != nil {
@@ -826,6 +835,9 @@ func (image *Image) LockShared(cookie string, tag string) error {
return GetError(C.rbd_lock_shared(image.image, c_cookie, c_tag))
}
+// Unlock releases a lock on the image.
+//
+// Implements:
// int rbd_lock_shared(rbd_image_t image, const char *cookie, const char *tag);
func (image *Image) Unlock(cookie string) error {
if err := image.validate(imageIsOpen); err != nil {
@@ -838,6 +850,9 @@ func (image *Image) Unlock(cookie string) error {
return GetError(C.rbd_unlock(image.image, c_cookie))
}
+// BreakLock forces the release of a lock held by another client.
+//
+// Implements:
// int rbd_break_lock(rbd_image_t image, const char *client, const char *cookie);
func (image *Image) BreakLock(client string, cookie string) error {
if err := image.validate(imageIsOpen); err != nil {
