<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 13, 2018 at 9:00 PM Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 08/03/2018 02:28 PM, Nir Soffer wrote:<br>
> fallocate(FALLOC_FL_ZERO_RANGE) is supportd for block devices with<br>
<br>
s/supportd/supported/<br>
<br>
> modern kernel, but when it is not, we fall back to manual zeroing.<br>
> <br>
> For block device, try also to use ioctl(BLKZEROOUT) if offset and count<br>
> are aligned to block device sector size.<br>
> <br>
> Here is an example run without this change on RHEL 7.5:<br>
> <br>
<br>
> +++ b/plugins/file/file.c<br>
> @@ -41,14 +41,21 @@<br>
>   #include <unistd.h><br>
>   #include <sys/types.h><br>
>   #include <sys/stat.h><br>
> +#include <sys/ioctl.h><br>
<br>
Linux-specific header; will it cause grief on BSD compilation?<br></blockquote><div><br></div><div>I did not know that, will wrap it with #ifdef __linux__</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(POSIX declares ioctl() in <stropts.h>, but for the obsolete STREAMS <br>
extension that no one but Solaris ever implemented, and which no one <br>
uses today - and thus which has little bearing on the Linux use of ioctl).<br>
<br>
Otherwise looks okay.<br>
<br>
-- <br>
Eric Blake, Principal Software Engineer<br>
Red Hat, Inc.           <a href="tel:(919)%20301-3266" value="+19193013266" target="_blank">+1-919-301-3266</a><br>
Virtualization:  <a href="http://qemu.org" rel="noreferrer" target="_blank">qemu.org</a> | <a href="http://libvirt.org" rel="noreferrer" target="_blank">libvirt.org</a><br>
</blockquote></div></div>