mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd::db: Advise sequential access for sequential file type.
This commit is contained in:
parent
c114191251
commit
fbb88b87c1
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <RB_INC_FCNTL_H
|
||||
#include "db.h"
|
||||
|
||||
//
|
||||
|
@ -2799,6 +2800,11 @@ try
|
|||
name
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_SEQUENTIAL)
|
||||
if(!opts.direct)
|
||||
syscall(::posix_fadvise, fd, offset, off_t(0), POSIX_FADV_SEQUENTIAL);
|
||||
#endif
|
||||
}
|
||||
catch(const std::system_error &e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue