mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
posix_fadvice advice parameter change
With a bit of manual rereading and thinking I came to conclusion that users will most likely fetch same data over and over again. Advicing to kernel to keep pages into cache seems to be correct thing to do. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
f32e023ecf
commit
10488b0a04
1 changed files with 10 additions and 10 deletions
|
|
@ -76,16 +76,16 @@ int parse_leases(void)
|
|||
err(EXIT_FAILURE, "parse_leases: %s",
|
||||
config.dhcpdlease_file);
|
||||
}
|
||||
#ifdef POSIX_FADV_NOREUSE
|
||||
posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_NOREUSE);
|
||||
#ifdef POSIX_FADV_WILLNEED
|
||||
posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_WILLNEED);
|
||||
if (errno) {
|
||||
err(EXIT_FAILURE, "parse_leases: fadvise noreuse");
|
||||
err(EXIT_FAILURE, "parse_leases: fadvise %s", config.dhcpdlease_file);
|
||||
}
|
||||
#endif /* POSIX_FADV_NOREUSE */
|
||||
#endif /* POSIX_FADV_WILLNEED */
|
||||
#ifdef POSIX_FADV_SEQUENTIAL
|
||||
posix_fadvise((long) dhcpd_leases, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
if (errno) {
|
||||
err(EXIT_FAILURE, "parse_leases: fadvise sequential");
|
||||
err(EXIT_FAILURE, "parse_leases: fadvise %s", config.dhcpdlease_file);
|
||||
}
|
||||
#endif /* POSIX_FADV_SEQUENTIAL */
|
||||
|
||||
|
|
@ -228,16 +228,16 @@ char *parse_config(int is_include, char *config_file,
|
|||
if (dhcpd_config == NULL) {
|
||||
err(EXIT_FAILURE, "parse_config: %s", config_file);
|
||||
}
|
||||
#ifdef POSIX_FADV_NOREUSE
|
||||
posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_NOREUSE);
|
||||
#ifdef POSIX_FADV_WILLNEED
|
||||
posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_WILLNEED);
|
||||
if (errno) {
|
||||
err(EXIT_FAILURE, "parse_config: fadvise noreuse");
|
||||
err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
|
||||
}
|
||||
#endif /* POSIX_FADV_NOREUSE */
|
||||
#endif /* POSIX_FADV_WILLNEED */
|
||||
#ifdef POSIX_FADV_SEQUENTIAL
|
||||
posix_fadvise((long) dhcpd_config, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
if (errno) {
|
||||
err(EXIT_FAILURE, "parse_config: fadvise sequential");
|
||||
err(EXIT_FAILURE, "parse_config: fadvise %s", config_file);
|
||||
}
|
||||
#endif /* POSIX_FADV_SEQUENTIAL */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue