summaryrefslogtreecommitdiffstats
path: root/src/libcephfs.cc
diff options
context:
space:
mode:
authorPatrick Donnelly <pdonnell@redhat.com>2018-09-24 23:41:59 +0200
committerPatrick Donnelly <pdonnell@redhat.com>2018-09-24 23:42:13 +0200
commit51b27b7e3dcfbf8aca92f1db41067fe3df1339d3 (patch)
treeb5eae7140aae7c606fed499bb357aa23f7b656a0 /src/libcephfs.cc
parentMerge PR #24125 into master (diff)
parentqa/vstart_runner: fix daemons list (diff)
downloadceph-51b27b7e3dcfbf8aca92f1db41067fe3df1339d3.tar.xz
ceph-51b27b7e3dcfbf8aca92f1db41067fe3df1339d3.zip
Merge PR #23530 into master
* refs/pull/23530/head: qa/vstart_runner: fix daemons list PendingReleaseNotes: note multifs support in libcephfs test/cephfs: add pybind test for mount_root pybind/cephfs: enable passing filesystem name to mount libcephfs: add ceph_select_filesystem common: add doc strings to client_mds_namespace client: allow passing fs name to mount() Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Conflicts: PendingReleaseNotes
Diffstat (limited to 'src/libcephfs.cc')
-rw-r--r--src/libcephfs.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/libcephfs.cc b/src/libcephfs.cc
index 1f6ba5cb92b..eff9cc70a73 100644
--- a/src/libcephfs.cc
+++ b/src/libcephfs.cc
@@ -127,6 +127,16 @@ public:
return ret;
}
+ int select_filesystem(const std::string &fs_name_)
+ {
+ if (mounted) {
+ return -EISCONN;
+ }
+
+ fs_name = fs_name_;
+ return 0;
+ }
+
int mount(const std::string &mount_root, const UserPerm& perms)
{
int ret;
@@ -141,7 +151,7 @@ public:
}
}
- ret = client->mount(mount_root, perms);
+ ret = client->mount(mount_root, perms, false, fs_name);
if (ret) {
shutdown();
return ret;
@@ -283,6 +293,7 @@ private:
Messenger *messenger;
CephContext *cct;
std::string cwd;
+ std::string fs_name;
};
static mode_t umask_cb(void *handle)
@@ -494,6 +505,16 @@ extern "C" int ceph_init(struct ceph_mount_info *cmount)
return cmount->init();
}
+extern "C" int ceph_select_filesystem(struct ceph_mount_info *cmount,
+ const char *fs_name)
+{
+ if (fs_name == nullptr) {
+ return -EINVAL;
+ }
+
+ return cmount->select_filesystem(fs_name);
+}
+
extern "C" int ceph_mount(struct ceph_mount_info *cmount, const char *root)
{
std::string mount_root;