[Libguestfs] [PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.

Pino Toscano ptoscano at redhat.com
Thu Apr 14 14:14:50 UTC 2016


On Thursday 14 April 2016 14:54:18 Richard W.M. Jones wrote:
> Add wrappers around posix_fadvise and use 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.
> ---

Mostly ok, just one note below:

> +extern void guestfs_int_fadvise_dontneed (int fd);

Unless I'm mistaken, _dontneed is not used yet, so IMHO it would be
better to not add it for now; it can always be added when needed.

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160414/2d78f09a/attachment.sig>


More information about the Libguestfs mailing list