mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 16:34:13 +01:00
ircd::db: Log warning when crc32c acceleration is not available.
This commit is contained in:
parent
ae4ae66f08
commit
c6d056421d
1 changed files with 29 additions and 0 deletions
29
ircd/db.cc
29
ircd/db.cc
|
@ -86,6 +86,7 @@ ircd::db::write_mutex;
|
|||
namespace ircd::db
|
||||
{
|
||||
static std::string direct_io_test_file_path();
|
||||
static void init_test_hw_crc32();
|
||||
static void init_test_direct_io();
|
||||
static void init_compressions();
|
||||
static void init_directory();
|
||||
|
@ -141,6 +142,7 @@ ircd::db::init::init()
|
|||
init_compressions();
|
||||
init_directory();
|
||||
init_test_direct_io();
|
||||
init_test_hw_crc32();
|
||||
request.add(request_pool_size);
|
||||
}
|
||||
|
||||
|
@ -254,6 +256,33 @@ ircd::db::direct_io_test_file_path()
|
|||
return fs::path_string(fs::DB, test_file_name);
|
||||
}
|
||||
|
||||
namespace rocksdb::crc32c
|
||||
{
|
||||
extern std::string IsFastCrc32Supported();
|
||||
}
|
||||
|
||||
void
|
||||
ircd::db::init_test_hw_crc32()
|
||||
{
|
||||
const auto supported_str
|
||||
{
|
||||
rocksdb::crc32c::IsFastCrc32Supported()
|
||||
};
|
||||
|
||||
const bool supported
|
||||
{
|
||||
startswith(supported_str, "Supported")
|
||||
};
|
||||
|
||||
assert(supported || startswith(supported_str, "Not supported"));
|
||||
|
||||
if(!supported)
|
||||
log::warning
|
||||
{
|
||||
log, "crc32c hardware acceleration is not available on this platform."
|
||||
};
|
||||
}
|
||||
|
||||
decltype(ircd::db::compressions)
|
||||
ircd::db::compressions;
|
||||
|
||||
|
|
Loading…
Reference in a new issue