0
0
Fork 0
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:
Jason Volk 2018-12-27 13:27:17 -08:00
parent d3d06b90f8
commit beb7a0c180

View file

@ -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
{ {