Displaying 2 results from an estimated 2 matches for "posix_fadv_normal".
2016 Apr 14
3
More posix_fadvise stuff.
More posix_fadvise stuff, and document what Linux really does
with these calls.
Also fixes a nasty bug in virt-builder.
Rich.
2020 Aug 07
3
[PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
...s/file/file.c
index 076e7531..a8e37cd9 100644
--- a/plugins/file/file.c
+++ b/plugins/file/file.c
@@ -66,6 +66,18 @@
static char *filename = NULL;
+/* posix_fadvise mode: -1 = don't set it, or POSIX_FADV_*. */
+static int fadvise_mode =
+#if defined (HAVE_POSIX_FADVISE) && defined (POSIX_FADV_NORMAL)
+ POSIX_FADV_NORMAL
+#else
+ -1
+#endif
+ ;
+
+/* cache mode */
+static enum { cache_default, cache_none } cache_mode = cache_default;
+
/* Any callbacks using lseek must be protected by this lock. */
static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -97,6 +109,46 @@ file_co...