*/
void ceph_shutdown(struct ceph_mount_info *cmount);
+/**
+ * Get a global id for current instance
+ *
+ * The handle should not be mounted. This should be called on completion of
+ * all libcephfs functions.
+ *
+ * @param cmount the mount handle
+ * @returns instance global id
+ */
+uint64_t ceph_get_instance_id(struct ceph_mount_info *cmount);
+
/**
* Extract the CephContext from the mount point handle.
*
cmount = nullptr;
}
+extern "C" uint64_t ceph_get_instance_id(struct ceph_mount_info *cmount)
+{
+ if (cmount->is_initialized())
+ return cmount->get_client()->get_nodeid().v;
+ return 0;
+}
+
extern "C" int ceph_conf_read_file(struct ceph_mount_info *cmount, const char *path)
{
return cmount->conf_read_file(path);
int ceph_mount(ceph_mount_info *cmount, const char *root)
int ceph_unmount(ceph_mount_info *cmount)
int ceph_abort_conn(ceph_mount_info *cmount)
+ uint64_t ceph_get_instance_id(ceph_mount_info *cmount)
int ceph_fstatx(ceph_mount_info *cmount, int fd, statx *stx, unsigned want, unsigned flags)
int ceph_statx(ceph_mount_info *cmount, const char *path, statx *stx, unsigned want, unsigned flags)
int ceph_statfs(ceph_mount_info *cmount, const char *path, statvfs *stbuf)
raise make_ex(ret, "error calling ceph_abort_conn")
self.state = "initialized"
+ def get_instance_id(self):
+ """
+ Get a global id for current instance
+ """
+ self.require_state("initialized", "mounted")
+ with nogil:
+ ret = ceph_get_instance_id(self.cluster)
+ return ret;
+
def statfs(self, path):
"""
Perform a statfs on the ceph file system. This call fills in file system wide statistics
int rados_create_with_context(rados_t *cluster, rados_config_t cct)
int rados_connect(rados_t cluster)
void rados_shutdown(rados_t cluster)
+ uint64_t rados_get_instance_id(rados_t cluster)
int rados_conf_read_file(rados_t cluster, const char *path)
int rados_conf_parse_argv_remainder(rados_t cluster, int argc, const char **argv, const char **remargv)
int rados_conf_parse_env(rados_t cluster, const char *var)
raise make_ex(ret, "error connecting to the cluster")
self.state = "connected"
+ def get_instance_id(self):
+ """
+ Get a global id for current instance
+ """
+ self.require_state("connected")
+ with nogil:
+ ret = rados_get_instance_id(self.cluster)
+ return ret;
+
def get_cluster_stats(self):
"""
Read usage info about the cluster