0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-07 20:48:55 +02:00

ircd::fs: Callsite changes for fs::base reorg.

This commit is contained in:
Jason Volk 2020-04-19 00:26:54 -07:00
parent d8d5671e1e
commit 2bf38286ba
5 changed files with 24 additions and 27 deletions

View file

@ -104,7 +104,10 @@ struct ircd::m::matrix
std::string module_path
{
fs::path_string(fs::base::LIB, "libircd_matrix")
fs::path_string(fs::path_views
{
fs::base::lib, "libircd_matrix"
})
};
ircd::module module

View file

@ -164,9 +164,9 @@ void
ircd::db::init::directory()
try
{
const auto dbdir
const string_view &dbdir
{
fs::path(fs::base::db)
fs::base::db
};
if(!fs::is_dir(dbdir) && (ircd::read_only || ircd::write_avoid))
@ -215,7 +215,7 @@ try
{
log, "Direct-IO is not supported in the database directory `%s'"
"; Concurrent database queries will not be possible.",
fs::basepath::get(fs::base::DB)
string_view{fs::base::db}
};
}
catch(const std::exception &e)
@ -237,7 +237,10 @@ ircd::db::direct_io_test_file_path()
"SUPPORTS_DIRECT_IO"_sv
};
return fs::path_string(fs::base::DB, test_file_name);
return fs::path_string(fs::path_views
{
fs::base::db, test_file_name
});
}
namespace rocksdb::crc32c
@ -3498,7 +3501,7 @@ ircd::db::database::sst::dump::dump(db::column column,
{
const string_view path_parts[]
{
fs::path(fs::base::DB), db::name(d), db::name(c)
fs::base::db, db::name(d), db::name(c)
};
path = fs::path_string(path_parts);
@ -8195,9 +8198,9 @@ ircd::db::operator+=(rocksdb::WriteOptions &ret,
std::vector<std::string>
ircd::db::available()
{
const auto &prefix
const string_view &prefix
{
fs::path(fs::base::DB)
fs::base::db
};
const auto dirs
@ -8261,7 +8264,7 @@ ircd::db::path(const string_view &name,
{
const auto &prefix
{
fs::path(fs::base::DB)
fs::base::db
};
const string_view parts[]

View file

@ -282,16 +282,6 @@ ircd::fs::support::dump_info()
{
log, "Current working directory: `%s'", cwd(buf)
};
for_each<base>([](const base &base)
{
log::debug
{
log, "Working %s is `%s'",
basepath::get(base).name,
basepath::get(base).path,
};
});
#endif
}

View file

@ -1146,7 +1146,7 @@ catch(const boost::system::system_error &e)
decltype(ircd::mods::prefix)
ircd::mods::prefix
{
fs::path(fs::base::MODULES)
fs::base::modules
};
decltype(ircd::mods::suffix)

View file

@ -81,19 +81,20 @@ ircd::m::dbs::init::init(const string_view &servername,
std::string dbopts)
:our_dbpath
{
ircd::string(fs::PATH_MAX_LEN | SHRINK_TO_FIT, [&servername]
(const mutable_buffer &buf)
fs::path_string(fs::path_views
{
return fs::path(buf, fs::base::DB, servername);
fs::base::db, servername
})
}
,their_dbpath
{
// NOTE that this is a global change that leaks outside of ircd::m. The
// database directory for the entire process is being changed here.
fs::basepath::set(fs::base::DB, our_dbpath)
fs::base::db
}
{
// NOTE that this is a global change that leaks outside of ircd::m. The
// database directory for the entire process is being changed here.
fs::base::db.set(our_dbpath);
// Recall the db directory init manually with the now-updated basepath
db::init::directory();
@ -138,7 +139,7 @@ noexcept
events = {};
// restore the fs::base::DB path the way we found it.
fs::basepath::set(fs::base::DB, their_dbpath);
fs::base::db.set(their_dbpath);
}
//