]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph_fuse.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / ceph_fuse.cc
index 5ae9404d89756756aedbcd4128e5af35ca46c340..b7f8a4d4b90197879f6972e2cf9fa32d9d7816f5 100644 (file)
@@ -16,7 +16,9 @@
 #include <sys/utsname.h>
 #include <iostream>
 #include <string>
+#include <optional>
 
+#include "common/async/context_pool.h"
 #include "common/config.h"
 #include "common/errno.h"
 
@@ -45,6 +47,8 @@
 
 #define dout_context g_ceph_context
 
+ceph::async::io_context_pool icp;
+
 static void fuse_usage()
 {
   const char* argv[] = {
@@ -54,7 +58,15 @@ static void fuse_usage()
   struct fuse_args args = FUSE_ARGS_INIT(2, (char**)argv);
 #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
   struct fuse_cmdline_opts opts = {};
-  if (fuse_parse_cmdline(&args, &opts) == -1) {
+  if (fuse_parse_cmdline(&args, &opts) != -1) {
+    if (opts.show_help) {
+      cout << "usage: " << argv[0] << " [options] <mountpoint>\n\n";
+      cout << "FUSE options:\n";
+      fuse_cmdline_help();
+      fuse_lowlevel_help();
+      cout << "\n";
+    }
+  } else {
 #else
   if (fuse_parse_cmdline(&args, nullptr, nullptr, nullptr) == -1) {
 #endif
@@ -233,7 +245,8 @@ int main(int argc, const char **argv, const char *envp[]) {
     int tester_r = 0;
     void *tester_rp = nullptr;
 
-    MonClient *mc = new MonClient(g_ceph_context);
+    icp.start(cct->_conf.get_val<std::uint64_t>("client_asio_thread_count"));
+    MonClient *mc = new MonClient(g_ceph_context, icp);
     int r = mc->build_initial_monmap();
     if (r == -EINVAL) {
       cerr << "failed to generate initial mon list" << std::endl;
@@ -248,7 +261,7 @@ int main(int argc, const char **argv, const char *envp[]) {
     messenger->set_policy(entity_name_t::TYPE_MDS,
                          Messenger::Policy::lossless_client(0));
 
-    client = new StandaloneClient(messenger, mc);
+    client = new StandaloneClient(messenger, mc, icp);
     if (filer_flags) {
       client->set_filer_flags(filer_flags);
     }
@@ -315,6 +328,7 @@ int main(int argc, const char **argv, const char *envp[]) {
     client->unmount();
     cfuse->finalize();
   out_shutdown:
+    icp.stop();
     client->shutdown();
   out_init_failed:
     unregister_async_signal_handler(SIGHUP, sighup_handler);