mirror of
https://github.com/matrix-construct/construct
synced 2024-06-08 13:08:56 +02:00
ircd::db: Check for posix_fadvise(); implement InvalidateCache for environment if not direct IO.
This commit is contained in:
parent
1d03747da3
commit
49bad9f01d
|
@ -657,7 +657,8 @@ AC_CHECK_FUNCS([ \
|
|||
strlcat \
|
||||
strnlen \
|
||||
snprintf \
|
||||
vsnprintf
|
||||
vsnprintf \
|
||||
posix_fadvise \
|
||||
])
|
||||
|
||||
AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo]))
|
||||
|
|
23
ircd/db.cc
23
ircd/db.cc
|
@ -4677,7 +4677,13 @@ noexcept try
|
|||
};
|
||||
#endif
|
||||
|
||||
//syscall(::posix_fadvise, fd, offset, length, FADV_DONTNEED);
|
||||
if(opts.direct)
|
||||
return Status::OK();
|
||||
|
||||
#if defined(HAVE_POSIX_FADVISE) && defined(FADV_DONTNEED)
|
||||
syscall(::posix_fadvise, fd, offset, length, FADV_DONTNEED);
|
||||
#endif
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
catch(const fs::error &e)
|
||||
|
@ -5109,6 +5115,7 @@ noexcept
|
|||
#endif
|
||||
|
||||
this->hint = hint;
|
||||
//TODO: fcntl F_SET_FILE_RW_HINT
|
||||
}
|
||||
|
||||
rocksdb::Env::WriteLifeTimeHint
|
||||
|
@ -5423,6 +5430,13 @@ noexcept try
|
|||
};
|
||||
#endif
|
||||
|
||||
if(opts.direct)
|
||||
return Status::OK();
|
||||
|
||||
#if defined(HAVE_POSIX_FADVISE) && defined(FADV_DONTNEED)
|
||||
syscall(::posix_fadvise, fd, offset, length, FADV_DONTNEED);
|
||||
#endif
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
catch(const fs::error &e)
|
||||
|
@ -5673,6 +5687,13 @@ noexcept
|
|||
};
|
||||
#endif
|
||||
|
||||
if(opts.direct)
|
||||
return Status::OK();
|
||||
|
||||
#if defined(HAVE_POSIX_FADVISE) && defined(FADV_DONTNEED)
|
||||
syscall(::posix_fadvise, fd, offset, length, FADV_DONTNEED);
|
||||
#endif
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue