* buffer is too short. */
int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len);
+/* cluster info */
+int rados_statfs(rados_t cluster, struct rados_statfs_t *result);
+
+
/* pools */
/* Gets a list of pool names as NULL-terminated strings.
int pool_list(std::list<std::string>& v);
int get_pool_stats(std::list<std::string>& v,
std::map<std::string,pool_stat_t>& stats);
- int get_fs_stats(statfs_t& result);
+ int statfs(statfs_t& result);
// -- aio --
static AioCompletion *aio_create_completion();
}
int librados::Rados::
-get_fs_stats(statfs_t& result)
+statfs(statfs_t& result)
{
ceph_statfs stats;
int r = client->get_fs_stats(stats);
sighup_handler(SIGHUP);
}
+/* cluster info */
+extern "C" int rados_statfs(rados_t cluster, rados_statfs_t *result)
+{
+ librados::RadosClient *client = (librados::RadosClient *)cluster;
+
+ ceph_statfs stats;
+ int r = client->get_fs_stats(stats);
+ result->kb = stats.kb;
+ result->kb_used = stats.kb_used;
+ result->kb_avail = stats.kb_avail;
+ result->num_objects = stats.num_objects;
+ return r;
+}
+
extern "C" int rados_conf_get(rados_t cluster, const char *option, char *buf, size_t len)
{
char *tmp = buf;
// total
statfs_t tstats;
- rados.get_fs_stats(tstats);
+ rados.statfs(tstats);
printf(" total used %12lld %12lld\n", (long long unsigned)tstats.kb_used,
(long long unsigned)tstats.num_objects);
printf(" total avail %12lld\n", (long long unsigned)tstats.kb_avail);