interrupt_finisher(m->cct),
remount_finisher(m->cct),
objecter_finisher(m->cct),
- m_command_hook(this)
+ m_command_hook(this),
+ fscid(0)
{
_reset_faked_inos();
r = fetch_fsmap(true);
if (r < 0)
return r;
- fs_cluster_id_t cid = fsmap_user->get_fs_cid(resolved_fs_name);
- if (cid == FS_CLUSTER_ID_NONE) {
+ fscid = fsmap_user->get_fs_cid(resolved_fs_name);
+ if (fscid == FS_CLUSTER_ID_NONE) {
return -ENOENT;
}
std::ostringstream oss;
- oss << want << "." << cid;
+ oss << want << "." << fscid;
want = oss.str();
}
ldout(cct, 10) << "Subscribing to map '" << want << "'" << dendl;
const std::string& fs_name);
void finish_reclaim();
+ fs_cluster_id_t get_fs_cid() {
+ return fscid;
+ }
+
int mds_command(
const std::string &mds_spec,
const std::vector<std::string>& cmd,
bool _use_faked_inos;
+ // Cluster fsid
+ fs_cluster_id_t fscid;
+
// file handles, etc.
interval_set<int> free_fd_set; // unused fds
ceph::unordered_map<int, Fh*> fd_map;
*/
int ceph_mount(struct ceph_mount_info *cmount, const char *root);
+/**
+ * Return cluster ID for a mounted ceph filesystem
+ *
+ * Every ceph filesystem has a filesystem ID associated with it. This
+ * function returns that value. If the ceph_mount_info does not refer to a
+ * mounted filesystem, this returns a negative error code.
+ */
+int64_t ceph_get_fs_cid(struct ceph_mount_info *cmount);
+
/**
* Execute a management command remotely on an MDS.
*
return &cmount->default_perms;
}
+extern "C" int64_t ceph_get_fs_cid(struct ceph_mount_info *cmount)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->get_fs_cid();
+}
+
extern "C" int ceph_mount_perms_set(struct ceph_mount_info *cmount,
struct UserPerm *perms)
{