search for: posix_fadv_sequenti

Displaying 9 results from an estimated 9 matches for "posix_fadv_sequenti".

Did you mean: posix_fadv_sequential
2016 Apr 14
0
[PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.
...irectly. diff --git a/src/proto.c b/src/proto.c index 722ac9f..cbf8680 100644 --- a/src/proto.c +++ b/src/proto.c @@ -333,19 +333,6 @@ guestfs_int_send (guestfs_h *g, int proc_nr, return serial; } -static void -fadvise_sequential (int fd) -{ -#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_SEQUENTIAL) - /* Since the fd might be a non-file, eg. /dev/stdout, just ignore - * this when it fails. It's not clear from the man page, but the - * 'advice' parameter is NOT a bitmask. You can only pass one - * parameter with each call. - */ - ignore_value (posix_fadvise (fd, 0, 0,...
2016 Apr 14
3
builder: posix_fadvise fixes.
The way we used posix_fadvise was wrong, and yet right! Rich.
2014 Nov 23
0
[PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.
...opendir: %s", orig_path); + return -1; + } + } + else { + /* Open a regular file. */ + fd = open (path, O_RDONLY | O_CLOEXEC); + if (fd == -1) { + reply_with_perror ("%s", orig_path); + return -1; + } + + posix_fadvise (fd, 0, 0, + POSIX_FADV_SEQUENTIAL | + POSIX_FADV_NOREUSE | + POSIX_FADV_DONTNEED); + } + + return 0; +} + +int +do_bmap_file (const char *path) +{ + CLEANUP_FREE char *buf = NULL; + + buf = sysroot_path (path); + if (!buf) { + reply_with_perror ("malloc"); + return -1; + }...
2014 Nov 23
7
[PATCH 0/3] patches needed for virt-bmap
See http://rwmj.wordpress.com/2014/11/23/mapping-files-to-disk/
2014 Nov 24
1
Re: [PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.
...+ if (fd == -1) { > + reply_with_perror ("%s", orig_path); > + return -1; > + } Wouldn't be better to just always open the file, stat the fd, and if it's a directory fdopendir + close it? > + > + posix_fadvise (fd, 0, 0, > + POSIX_FADV_SEQUENTIAL | > + POSIX_FADV_NOREUSE | > + POSIX_FADV_DONTNEED); > + } > + > + return 0; > +} > + > +int > +do_bmap_file (const char *path) > +{ > + CLEANUP_FREE char *buf = NULL; > + > + buf = sysroot_path (path); > + if (!bu...
2014 Nov 24
2
[PATCH v2 0/2] patches needed for virt-bmap
Does *not* incorporate changes suggested by Pino yet. Rich.
2020 Aug 07
3
[PATCH nbdkit] file: Implement cache=none and fadvise=normal|random|sequential.
...;random") == 0) { +#if defined (HAVE_POSIX_FADVISE) && defined (POSIX_FADV_RANDOM) + fadvise_mode = POSIX_FADV_RANDOM; +#else + fadvise_mode = -1; +#endif + } + else if (strcmp (value, "sequential") == 0) { +#if defined (HAVE_POSIX_FADVISE) && defined (POSIX_FADV_SEQUENTIAL) + fadvise_mode = POSIX_FADV_SEQUENTIAL; +#else + fadvise_mode = -1; +#endif + } + else { + nbdkit_error ("unknown fadvise mode: %s", value); + return -1; + } + } + else if (strcmp (key, "cache") == 0) { + if (strcmp (value, "default&quot...
2020 Aug 06
0
Re: [PATCH nbdkit] Experiment with parallel python plugin
...rallel I/O does not buy us much when using buffered I/O. pwrite() > copies data to the page cache, and pread() reads data from the page > cache. O_DIRECT is unfortunately a bit too fragile to consider using routinely. But I wonder if one of the posix_fadvise(2) hints could be used (eg. POSIX_FADV_SEQUENTIAL + POSIX_FADV_DONTNEED). Adding fadvise hints as a parameter for the file plugin is a very plausible change. > - Disable extents in the file plugin. This way we can compare it with > the python file example. > > - Implement flush in the file example. > > With these changes,...
2020 Aug 06
2
[PATCH nbdkit] Experiment with parallel python plugin
This is a quick hack to experiment with parallel threading model in the python plugin. Changes: - Use aligned buffers to make it possible to use O_DIRECT. Using parallel I/O does not buy us much when using buffered I/O. pwrite() copies data to the page cache, and pread() reads data from the page cache. - Disable extents in the file plugin. This way we can compare it with the python