Displaying 6 results from an estimated 6 matches for "posix_fadv_noreus".
Did you mean:
posix_fadv_noreuse
2016 Apr 14
3
builder: posix_fadvise fixes.
The way we used posix_fadvise was wrong, and yet right!
Rich.
2016 Apr 14
0
[PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.
...them in places we were
calling posix_fadvise directly before.
Also in virt-builder we were doing this (and ignoring the result):
posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED);
However the POSIX_FADV_* flags are _not_ bitmasks! In fact
POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED == POSIX_FADV_NOREUSE so we were
giving a completely different hint from what we thought we were
giving.
---
builder/pxzcat-c.c | 5 +--
src/guestfs-internal-frontend.h | 5 +++
src/proto.c | 17 +-------
src/utils.c | 87 +++++++++++++++++++++++++++++++++++++++++...
2014 Nov 23
0
[PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.
...-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;
+ }
+
+ return bmap_prepare (buf, path);
+}...
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.
...r ("%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 (!buf) {
> + reply_with_perror ("malloc&...
2014 Nov 24
2
[PATCH v2 0/2] patches needed for virt-bmap
Does *not* incorporate changes suggested by Pino yet.
Rich.