search for: fadvise_mode

Displaying 6 results from an estimated 6 matches for "fadvise_mode".

2020 Aug 07
3
[PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
...s on a file system known to diff --git a/plugins/file/file.c b/plugins/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_mut...
2020 Aug 07
2
[PATCH nbdkit] plugins: file: More standard cache mode names
...ugin.pod | 19 +++++++++++++------ tests/test-gzip.c | 2 +- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/plugins/file/file.c b/plugins/file/file.c index f6f91955..deac9b7f 100644 --- a/plugins/file/file.c +++ b/plugins/file/file.c @@ -76,7 +76,7 @@ static int fadvise_mode = ; /* cache mode */ -static enum { cache_default, cache_none } cache_mode = cache_default; +static enum { cache_writeback, cache_writethrough } cache_mode = cache_writeback; /* Any callbacks using lseek must be protected by this lock. */ static pthread_mutex_t lseek_lock = PTHREAD_MUTEX_...
2020 Aug 25
0
[RFC nbdkit PATCH 4/5] file: Utilize nbdkit_string_intern
...e.c +++ b/plugins/file/file.c @@ -64,8 +64,8 @@ #define fdatasync fsync #endif -static char *filename = NULL; -static char *directory = NULL; +static const char *filename = NULL; +static const char *directory = NULL; /* posix_fadvise mode: -1 = don't set it, or POSIX_FADV_*. */ static int fadvise_mode = @@ -91,13 +91,6 @@ is_enotsup (int err) return err == ENOTSUP || err == EOPNOTSUPP; } -static void -file_unload (void) -{ - free (filename); - free (directory); -} - /* Called for each key=value passed on the command line. This plugin * only accepts file=<filename> and dir=<di...
2020 Aug 08
0
Re: [PATCH nbdkit] plugins: file: More standard cache mode names
...tests/test-gzip.c | 2 +- > 3 files changed, 25 insertions(+), 18 deletions(-) > > diff --git a/plugins/file/file.c b/plugins/file/file.c > index f6f91955..deac9b7f 100644 > --- a/plugins/file/file.c > +++ b/plugins/file/file.c > @@ -76,7 +76,7 @@ static int fadvise_mode = > ; > > /* cache mode */ > -static enum { cache_default, cache_none } cache_mode = cache_default; > +static enum { cache_writeback, cache_writethrough } cache_mode = cache_writeback; > > /* Any callbacks using lseek must be protected by this lock. */ > static pth...
2020 Aug 08
1
Re: [PATCH nbdkit] plugins: file: More standard cache mode names
...| 2 +- > > 3 files changed, 25 insertions(+), 18 deletions(-) > > > > diff --git a/plugins/file/file.c b/plugins/file/file.c > > index f6f91955..deac9b7f 100644 > > --- a/plugins/file/file.c > > +++ b/plugins/file/file.c > > @@ -76,7 +76,7 @@ static int fadvise_mode = > > ; > > > > /* cache mode */ > > -static enum { cache_default, cache_none } cache_mode = cache_default; > > +static enum { cache_writeback, cache_writethrough } cache_mode = cache_writeback; > > > > /* Any callbacks using lseek must be protected by...
2020 Aug 25
9
[nbdkit PATCH 0/5] Implement .default_export, nbdkit_string_intern
More patches on the way for improving .list_exports signature and adding .export_description, but this is the promised code showing why nbdkit_string_intern is useful. Patch 4 is somewhat RFC: we could either add new API to take the boilerplate from: foo_config(const char *key, const char *value) { if (strcmp (key, "file") == 0) { CLEANUP_FREE char *tmp = nbdkit_realpath (value);