rados: support fetching the cluster from the Conn
The cephfs function ceph_create_from_rados requires the cluster_t
value, which is current private to the Conn type. Alias the cluster_t
type and allow other pkgs to get it if needed.
@@ -30,6 +30,14 @@ type Conn struct {
connected bool
}
+// ClusterRef represents a fundamental RADOS cluster connection.
+type ClusterRef C.rados_t
+
+// Cluster returns the underlying RADOS cluster reference for this Conn.
+func (c *Conn) Cluster() ClusterRef {
+ return ClusterRef(c.cluster)
+}
+
// PingMonitor sends a ping to a monitor and returns the reply.
func (c *Conn) PingMonitor(id string) (string, error) {
c_id := C.CString(id)
