0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

ircd::db: Get better required alignments for direct IO.

This commit is contained in:
Jason Volk 2018-08-28 19:38:55 -07:00
parent 5dd9b7a3cf
commit 5c6874c790

View file

@ -4179,7 +4179,23 @@ size_t
ircd::db::database::env::sequential_file::GetRequiredBufferAlignment() ircd::db::database::env::sequential_file::GetRequiredBufferAlignment()
const noexcept const noexcept
{ {
return ircd::info::page_size; const auto ret
{
fs::block_size(fd)
};
#ifdef RB_DEBUG_DB_ENV
log::debug
{
"'%s': seqfile:%p fd:%d required alignment (logical block size) %zu",
d.name,
this,
int(fd),
ret
};
#endif
return ret;
} }
// //
@ -4449,7 +4465,23 @@ size_t
ircd::db::database::env::random_access_file::GetRequiredBufferAlignment() ircd::db::database::env::random_access_file::GetRequiredBufferAlignment()
const noexcept const noexcept
{ {
return ircd::info::page_size; const auto ret
{
fs::block_size(fd)
};
#ifdef RB_DEBUG_DB_ENV
log::debug
{
"'%s': rfile:%p fd:%d required alignment (logical block size) %zu",
d.name,
this,
int(fd),
ret
};
#endif
return ret;
} }
// //
@ -4849,7 +4881,23 @@ size_t
ircd::db::database::env::random_rw_file::GetRequiredBufferAlignment() ircd::db::database::env::random_rw_file::GetRequiredBufferAlignment()
const noexcept const noexcept
{ {
return info::page_size; const auto ret
{
fs::block_size(fd)
};
#ifdef RB_DEBUG_DB_ENV
log::debug
{
"'%s': rwfile:%p fd:%d required alignment (logical block size) %zu",
d.name,
this,
int(fd),
ret
};
#endif
return ret;
} }
// //