]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: add client_fs mount option support 33506/head
authorXiubo Li <xiubli@redhat.com>
Mon, 24 Feb 2020 05:45:14 +0000 (00:45 -0500)
committerXiubo Li <xiubli@redhat.com>
Fri, 28 Feb 2020 00:30:31 +0000 (19:30 -0500)
"client_fs" is one alias for "client_mds_namespace=" and it will be
cleaner and be more user-friendly to use. "client_mds_namespace="
will be kept and backwards compatibility used.

Update the documents at the same time.

Fixes: https://tracker.ceph.com/issues/44212
Signed-off-by: Xiubo Li <xiubli@redhat.com>
doc/cephfs/mount-using-fuse.rst
doc/start/quick-cephfs.rst
qa/tasks/cephfs/fuse_mount.py
qa/tasks/vstart_runner.py
src/client/Client.cc
src/common/options.cc
src/include/cephfs/libcephfs.h

index 1b71193c7551f90d02b68adf2d37b61cb06faa26..98b19211dcba1ca74e97777c22c7f8b6ff2ad1a7 100644 (file)
@@ -55,11 +55,11 @@ root of CephFS on your local FS::
     ceph-fuse --id foo -r /path/to/dir /mnt/mycephfs
 
 If you have more than one FS on your Ceph cluster, use the option
-``--client_mds_namespace`` to mount the non-default FS::
+``--client_fs`` to mount the non-default FS::
 
-    ceph-fuse --id foo --client_mds_namespace mycephfs2 /mnt/mycephfs2
+    ceph-fuse --id foo --client_fs mycephfs2 /mnt/mycephfs2
 
-You may also add a ``client_mds_namespace`` setting to your ``ceph.conf``
+You may also add a ``client_fs`` setting to your ``ceph.conf``
 
 Unmounting CephFS
 =================
index b243edd6dbc9fd75455e34f06b39f0c53ae69694..d63df9b81d6ab3d7d524a84187a0f28a77afe396 100644 (file)
@@ -184,9 +184,9 @@ To mount a particular directory within CephFS you can use ``-r``::
     sudo ceph-fuse -r {path-to-be-mounted} /mnt/mycephfs
 
 If you have multiple file systems on your cluster you would need to pass
-``--client_mds_namespace {fs-name}`` to the ``ceph-fuse`` command::
+``--client_fs {fs-name}`` to the ``ceph-fuse`` command::
 
-       sudo ceph-fuse /mnt/mycephfs2 --client_mds_namespace mycephfs2
+       sudo ceph-fuse /mnt/mycephfs2 --client_fs mycephfs2
 
 Refer `ceph-fuse man page`_ and `Mount CephFS using FUSE`_ to read more about
 this.
index 626a0682f4ad67a1b2c498b43a9be4676c373ddc..29fa4319d65e87554cfa1b1f58aa75b325c4e36a 100644 (file)
@@ -68,7 +68,7 @@ class FuseMount(CephFSMount):
             fuse_cmd += ["--client_mountpoint={0}".format(mount_path)]
 
         if mount_fs_name is not None:
-            fuse_cmd += ["--client_mds_namespace={0}".format(mount_fs_name)]
+            fuse_cmd += ["--client_fs={0}".format(mount_fs_name)]
 
         fuse_cmd += [
             '--name', 'client.{id}'.format(id=self.client_id),
index aba91cb76a45dd25fbd91d28f9014b850c462feb..660882a06e95876516546077db604468b53f7759 100644 (file)
@@ -844,7 +844,7 @@ class LocalFuseMount(FuseMount):
             prefix += ["--client_mountpoint={0}".format(mount_path)]
 
         if mount_fs_name is not None:
-            prefix += ["--client_mds_namespace={0}".format(mount_fs_name)]
+            prefix += ["--client_fs={0}".format(mount_fs_name)]
 
         self.fuse_daemon = self.client_remote.run(args=
                                             prefix + [
index 737bfabe67f71329496ffa4f5cffd6acee964ed3..8099266435f5a5680e813c7f1baab37415120137 100644 (file)
@@ -5825,7 +5825,10 @@ int Client::subscribe_mdsmap(const std::string &fs_name)
 
   std::string resolved_fs_name;
   if (fs_name.empty()) {
-    resolved_fs_name = cct->_conf.get_val<std::string>("client_mds_namespace");
+    resolved_fs_name = cct->_conf.get_val<std::string>("client_fs");
+    if (resolved_fs_name.empty())
+           // Try the backwards compatibility fs name option
+           resolved_fs_name = cct->_conf.get_val<std::string>("client_mds_namespace");
   } else {
     resolved_fs_name = fs_name;
   }
index ce0853df50a4f025acdc4eaa6daf843a7f877709..74c308e5af53d60fd9452ea076b63375ccbbb5df 100644 (file)
@@ -8352,9 +8352,9 @@ std::vector<Option> get_mds_client_options() {
     .set_default(false)
     .set_description(""),
 
-    Option("client_mds_namespace", Option::TYPE_STR, Option::LEVEL_ADVANCED)
+    Option("client_fs", Option::TYPE_STR, Option::LEVEL_ADVANCED)
+    .set_flag(Option::FLAG_STARTUP)
     .set_default("")
-
     .set_description("CephFS file system name to mount")
     .set_long_description("Use this with ceph-fuse, or with any process "
         "that uses libcephfs.  Programs using libcephfs may also pass "
@@ -8362,6 +8362,11 @@ std::vector<Option> get_mds_client_options() {
         "If no filesystem name is given in mount() or this setting, the default "
         "filesystem will be mounted (usually the first created)."),
 
+    /* Alias for client_fs. Deprecated */
+    Option("client_mds_namespace", Option::TYPE_STR, Option::LEVEL_DEV)
+    .set_flag(Option::FLAG_STARTUP)
+    .set_default(""),
+
     Option("fake_statfs_for_testing", Option::TYPE_INT, Option::LEVEL_DEV)
     .set_default(0)
     .set_description("Set a value for kb and compute kb_used from total of num_bytes"),
index d574aee3700a1fdad719202ce07139ba22272b07..d5f774351fbf230c17305581020c95ad2c628549 100644 (file)
@@ -251,8 +251,8 @@ int ceph_init(struct ceph_mount_info *cmount);
  *
  * An error will be returned if this libcephfs instance is already
  * mounted. This function is an alternative to setting the global
- * client_mds_namespace setting.  Using this function enables multiple
- * libcephfs instances in the same process to mount different filesystems.
+ * client_fs setting.  Using this function enables multiple libcephfs
+ * instances in the same process to mount different filesystems.
  *
  * The filesystem name is *not* validated in this function.  That happens
  * during mount(), where an ENOENT error will result if a non-existent