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>
err(EXIT_FAILURE, "parse_leases: %s",
config.dhcpdlease_file);
}
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);
- 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) {
#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 */
}
#endif /* POSIX_FADV_SEQUENTIAL */
if (dhcpd_config == NULL) {
err(EXIT_FAILURE, "parse_config: %s", 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);
- 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) {
#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 */
}
#endif /* POSIX_FADV_SEQUENTIAL */