#include <sys/utsname.h>
#include <iostream>
#include <string>
+#include <optional>
+#include "common/async/context_pool.h"
#include "common/config.h"
#include "common/errno.h"
#define dout_context g_ceph_context
+using namespace std;
+
+ceph::async::io_context_pool icp;
+
static void fuse_usage()
{
const char* argv[] = {
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
int main(int argc, const char **argv, const char *envp[]) {
int filer_flags = 0;
//cerr << "ceph-fuse starting " << myrank << "/" << world << std::endl;
- std::vector<const char*> args;
- argv_to_vec(argc, argv, args);
+ auto args = argv_to_vec(argc, argv);
if (args.empty()) {
cerr << argv[0] << ": -h or --help for usage" << std::endl;
exit(1);
}
{
- g_ceph_context->_conf.finalize_reexpand_meta();
common_init_finish(g_ceph_context);
-
+
init_async_signal_handler();
register_async_signal_handler(SIGHUP, sighup_handler);
"client_try_dentry_invalidate");
bool can_invalidate_dentries =
client_try_dentry_invalidate && ver < KERNEL_VERSION(3, 18, 0);
- int tr = client->test_dentry_handling(can_invalidate_dentries);
+ auto test_result = client->test_dentry_handling(can_invalidate_dentries);
+ int tr = test_result.first;
+ bool abort_on_failure = test_result.second;
bool client_die_on_failed_dentry_invalidate = g_conf().get_val<bool>(
"client_die_on_failed_dentry_invalidate");
if (tr != 0 && client_die_on_failed_dentry_invalidate) {
}
}
}
+ if(abort_on_failure) {
+ ceph_abort();
+ }
return reinterpret_cast<void*>(tr);
#else
return reinterpret_cast<void*>(0);
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;
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);
}
client->unmount();
cfuse->finalize();
out_shutdown:
+ icp.stop();
client->shutdown();
out_init_failed:
unregister_async_signal_handler(SIGHUP, sighup_handler);