Loading src/client/path.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -161,8 +161,11 @@ bool resolve(const string& path, string& resolved, bool resolve_last_link) { resolved.push_back(path::separator); last_slash_pos = resolved.size() - 1; resolved.append(path, start, comp_size); if (matched_components < mnt_components.size()) { /* * This will be true for all path components outside of GKFS and up to the mountdir's parent path * The mountdir directory is considered to be inside GKFS as it is entirely virtual and does not need to exist */ if (matched_components < mnt_components.size() - 1) { // Outside GekkoFS if (matched_components == resolved_components && path.compare(start, comp_size, mnt_components.at(matched_components)) == 0) { Loading src/daemon/daemon.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -215,9 +215,6 @@ void init_environment() { * Destroys the margo, argobots, and mercury environments */ void destroy_enviroment() { GKFS_DATA->spdlogger()->debug("{}() Removing mount directory", __func__); boost::system::error_code ecode; bfs::remove_all(GKFS_DATA->mountdir(), ecode); GKFS_DATA->spdlogger()->debug("{}() Freeing I/O executions streams", __func__); for (unsigned int i = 0; i < RPC_DATA->io_streams().size(); i++) { ABT_xstream_join(RPC_DATA->io_streams().at(i)); Loading Loading @@ -363,10 +360,17 @@ int main(int argc, const char* argv[]) { GKFS_DATA->spdlogger()->info("{}() Initializing environment", __func__); assert(vm.count("mountdir")); auto mountdir = vm["mountdir"].as<string>(); // Create mountdir. We use this dir to get some information on the underlying fs with statfs in gkfs_statfs bfs::create_directories(mountdir); GKFS_DATA->mountdir(bfs::canonical(mountdir).native()); // Store mountdir and ensure parent dir exists as it is required for path resolution on the client try { bfs::path mountdir(vm["mountdir"].as<string>()); auto mountdir_parent = bfs::canonical(mountdir.parent_path()); GKFS_DATA->mountdir(fmt::format("{}/{}", mountdir_parent.native(), mountdir.leaf().native())); GKFS_DATA->spdlogger()->info("{}() Mountdir '{}'", __func__, GKFS_DATA->mountdir()); } catch (const std::exception& e) { auto emsg = fmt::format("Parent directory for given mountdir does not exist. err '{}' Exiting ...", e.what()); cerr << emsg << endl; exit(EXIT_FAILURE); } assert(vm.count("rootdir")); auto rootdir = vm["rootdir"].as<string>(); Loading Loading
src/client/path.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -161,8 +161,11 @@ bool resolve(const string& path, string& resolved, bool resolve_last_link) { resolved.push_back(path::separator); last_slash_pos = resolved.size() - 1; resolved.append(path, start, comp_size); if (matched_components < mnt_components.size()) { /* * This will be true for all path components outside of GKFS and up to the mountdir's parent path * The mountdir directory is considered to be inside GKFS as it is entirely virtual and does not need to exist */ if (matched_components < mnt_components.size() - 1) { // Outside GekkoFS if (matched_components == resolved_components && path.compare(start, comp_size, mnt_components.at(matched_components)) == 0) { Loading
src/daemon/daemon.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -215,9 +215,6 @@ void init_environment() { * Destroys the margo, argobots, and mercury environments */ void destroy_enviroment() { GKFS_DATA->spdlogger()->debug("{}() Removing mount directory", __func__); boost::system::error_code ecode; bfs::remove_all(GKFS_DATA->mountdir(), ecode); GKFS_DATA->spdlogger()->debug("{}() Freeing I/O executions streams", __func__); for (unsigned int i = 0; i < RPC_DATA->io_streams().size(); i++) { ABT_xstream_join(RPC_DATA->io_streams().at(i)); Loading Loading @@ -363,10 +360,17 @@ int main(int argc, const char* argv[]) { GKFS_DATA->spdlogger()->info("{}() Initializing environment", __func__); assert(vm.count("mountdir")); auto mountdir = vm["mountdir"].as<string>(); // Create mountdir. We use this dir to get some information on the underlying fs with statfs in gkfs_statfs bfs::create_directories(mountdir); GKFS_DATA->mountdir(bfs::canonical(mountdir).native()); // Store mountdir and ensure parent dir exists as it is required for path resolution on the client try { bfs::path mountdir(vm["mountdir"].as<string>()); auto mountdir_parent = bfs::canonical(mountdir.parent_path()); GKFS_DATA->mountdir(fmt::format("{}/{}", mountdir_parent.native(), mountdir.leaf().native())); GKFS_DATA->spdlogger()->info("{}() Mountdir '{}'", __func__, GKFS_DATA->mountdir()); } catch (const std::exception& e) { auto emsg = fmt::format("Parent directory for given mountdir does not exist. err '{}' Exiting ...", e.what()); cerr << emsg << endl; exit(EXIT_FAILURE); } assert(vm.count("rootdir")); auto rootdir = vm["rootdir"].as<string>(); Loading