// Override maintaining compatibility with older OSDs
// Set to true for testing. Users should NOT set this.
OPTION(osd_debug_override_acting_compat, OPT_BOOL, false)
+OPTION(osd_objectstore_fuse, OPT_BOOL, false)
OPTION(osd_bench_small_size_max_iops, OPT_U32, 100) // 100 IOPS
OPTION(osd_bench_large_size_max_throughput, OPT_U64, 100 << 20) // 100 MB/s
#include "common/io_priority.h"
#include "os/ObjectStore.h"
+#include "os/FuseStore.h"
#include "ReplicatedPG.h"
logger(NULL),
recoverystate_perf(NULL),
store(store_),
+ fuse_store(NULL),
log_client(cct, client_messenger, &mc->monmap, LogClient::NO_FLAGS),
clog(log_client.create_channel()),
whoami(id),
};
+int OSD::enable_disable_fuse(bool stop)
+{
+ int r;
+ string mntpath = g_conf->osd_data + "/fuse";
+ if (fuse_store && (stop || !g_conf->osd_objectstore_fuse)) {
+ dout(1) << __func__ << " disabling" << dendl;
+ fuse_store->stop();
+ delete fuse_store;
+ fuse_store = NULL;
+ r = ::rmdir(mntpath.c_str());
+ if (r < 0)
+ r = -errno;
+ if (r < 0) {
+ derr << __func__ << " failed to rmdir " << mntpath << dendl;
+ return r;
+ }
+ }
+ if (!fuse_store && g_conf->osd_objectstore_fuse) {
+ dout(1) << __func__ << " enabling" << dendl;
+ r = ::mkdir(mntpath.c_str(), 0700);
+ if (r < 0)
+ r = -errno;
+ if (r < 0 && r != -EEXIST) {
+ derr << __func__ << " unable to create " << mntpath << ": "
+ << cpp_strerror(r) << dendl;
+ return r;
+ }
+ fuse_store = new FuseStore(store, mntpath);
+ r = fuse_store->start();
+ if (r < 0) {
+ derr << __func__ << " unable to start fuse: " << cpp_strerror(r) << dendl;
+ delete fuse_store;
+ fuse_store = NULL;
+ return r;
+ }
+ }
+ return 0;
+}
+
int OSD::init()
{
CompatSet initial, diff;
return r;
}
+ enable_disable_fuse(false);
+
dout(2) << "boot" << dendl;
// initialize the daily loadavg with current 15min loadavg
monc->shutdown();
out:
+ enable_disable_fuse(true);
store->umount();
delete store;
+ store = NULL;
return r;
}
}
dout(10) << "syncing store" << dendl;
+ enable_disable_fuse(true);
store->umount();
delete store;
store = 0;
"clog_to_syslog",
"clog_to_syslog_facility",
"clog_to_syslog_level",
+ "osd_objectstore_fuse",
NULL
};
return KEYS;
changed.count("clog_to_syslog_facility")) {
update_log_config();
}
+ if (changed.count("osd_objectstore_fuse")) {
+ if (store) {
+ enable_disable_fuse(false);
+ }
+ }
check_config();
}