mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::db: Precache required buffer alignment of random access file for repeat calls.
This commit is contained in:
parent
c0058aa53c
commit
9da3d20e5c
2 changed files with 7 additions and 7 deletions
|
@ -26,6 +26,7 @@ struct ircd::db::database::env::random_access_file final
|
|||
database &d;
|
||||
fs::fd::opts opts;
|
||||
fs::fd fd;
|
||||
size_t _buffer_align;
|
||||
|
||||
bool use_direct_io() const noexcept override;
|
||||
size_t GetRequiredBufferAlignment() const noexcept override;
|
||||
|
|
13
ircd/db.cc
13
ircd/db.cc
|
@ -5179,6 +5179,10 @@ try
|
|||
{
|
||||
name, this->opts
|
||||
}
|
||||
,_buffer_align
|
||||
{
|
||||
fs::block_size(fd)
|
||||
}
|
||||
{
|
||||
#ifdef RB_DEBUG_DB_ENV
|
||||
log::debug
|
||||
|
@ -5417,11 +5421,6 @@ size_t
|
|||
ircd::db::database::env::random_access_file::GetRequiredBufferAlignment()
|
||||
const noexcept
|
||||
{
|
||||
const auto ret
|
||||
{
|
||||
fs::block_size(fd)
|
||||
};
|
||||
|
||||
#ifdef RB_DEBUG_DB_ENV
|
||||
log::debug
|
||||
{
|
||||
|
@ -5429,11 +5428,11 @@ const noexcept
|
|||
d.name,
|
||||
this,
|
||||
int(fd),
|
||||
ret
|
||||
_buffer_align
|
||||
};
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
return _buffer_align;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue