mirror of
https://github.com/ceph/go-ceph
synced 2024-12-27 00:32:08 +00:00
rados: add a validate() function to IOContexts
The validate function works similarly to those already found in rbd and cephfs. It will be used in future functions or updated functions to ensure the C ioctx is ready for use. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
085e2049b3
commit
9179f8df29
@ -92,6 +92,15 @@ type IOContext struct {
|
||||
ioctx C.rados_ioctx_t
|
||||
}
|
||||
|
||||
// validate returns an error if the ioctx is not ready to be used
|
||||
// with ceph C calls.
|
||||
func (ioctx *IOContext) validate() error {
|
||||
if ioctx.ioctx == nil {
|
||||
return ErrNotConnected
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Pointer returns a pointer reference to an internal structure.
|
||||
// This function should NOT be used outside of go-ceph itself.
|
||||
func (ioctx *IOContext) Pointer() unsafe.Pointer {
|
||||
|
Loading…
Reference in New Issue
Block a user