mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 23:44:01 +01:00
ircd::db: Bypass call for block_size when not direct io.
This commit is contained in:
parent
d3d06b90f8
commit
beb7a0c180
1 changed files with 12 additions and 6 deletions
18
ircd/db.cc
18
ircd/db.cc
|
@ -6289,7 +6289,9 @@ try
|
||||||
}
|
}
|
||||||
,_buffer_align
|
,_buffer_align
|
||||||
{
|
{
|
||||||
fs::block_size(fd)
|
opts.direct?
|
||||||
|
fs::block_size(fd):
|
||||||
|
0
|
||||||
}
|
}
|
||||||
,offset
|
,offset
|
||||||
{
|
{
|
||||||
|
@ -6679,7 +6681,9 @@ try
|
||||||
}
|
}
|
||||||
,_buffer_align
|
,_buffer_align
|
||||||
{
|
{
|
||||||
fs::block_size(fd)
|
opts.direct?
|
||||||
|
fs::block_size(fd):
|
||||||
|
0
|
||||||
}
|
}
|
||||||
,aio
|
,aio
|
||||||
{
|
{
|
||||||
|
@ -6963,16 +6967,16 @@ ircd::db::database::env::random_rw_file::default_opts{[]
|
||||||
|
|
||||||
ircd::db::database::env::random_rw_file::random_rw_file(database *const &d,
|
ircd::db::database::env::random_rw_file::random_rw_file(database *const &d,
|
||||||
const std::string &name,
|
const std::string &name,
|
||||||
const EnvOptions &opts)
|
const EnvOptions &env_opts)
|
||||||
try
|
try
|
||||||
:d
|
:d
|
||||||
{
|
{
|
||||||
*d
|
*d
|
||||||
}
|
}
|
||||||
,opts{[&opts]
|
,opts{[&env_opts]
|
||||||
{
|
{
|
||||||
fs::fd::opts ret{default_opts};
|
fs::fd::opts ret{default_opts};
|
||||||
ret.direct = opts.use_direct_reads && opts.use_direct_writes;
|
ret.direct = env_opts.use_direct_reads && env_opts.use_direct_writes;
|
||||||
return ret;
|
return ret;
|
||||||
}()}
|
}()}
|
||||||
,fd
|
,fd
|
||||||
|
@ -6981,7 +6985,9 @@ try
|
||||||
}
|
}
|
||||||
,_buffer_align
|
,_buffer_align
|
||||||
{
|
{
|
||||||
fs::block_size(fd)
|
opts.direct?
|
||||||
|
fs::block_size(fd):
|
||||||
|
0
|
||||||
}
|
}
|
||||||
,aio
|
,aio
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue