Re: [Libguestfs] [libnbd PATCH] api: Speed up nbd_pread_structured when reading holes

2022-05-31 Thread Eric Blake
On Sat, May 28, 2022 at 06:18:27PM +0100, Richard W.M. Jones wrote: > On Fri, May 27, 2022 at 05:25:43PM -0500, Eric Blake wrote: > > Commit c7fbc71d missed an optimization: when we guarantee that a pread > > buffer is pre-zeroed, we don't need to waste time memset()ing it when > > the server

Re: [Libguestfs] [libnbd PATCH] api: Speed up nbd_pread_structured when reading holes

2022-05-28 Thread Richard W.M. Jones
On Fri, May 27, 2022 at 05:25:43PM -0500, Eric Blake wrote: > Commit c7fbc71d missed an optimization: when we guarantee that a pread > buffer is pre-zeroed, we don't need to waste time memset()ing it when > the server sends a hole. But the next commit e0953cb7 lets the user > skip pre-zeroing, at

[Libguestfs] [libnbd PATCH] api: Speed up nbd_pread_structured when reading holes

2022-05-27 Thread Eric Blake
Commit c7fbc71d missed an optimization: when we guarantee that a pread buffer is pre-zeroed, we don't need to waste time memset()ing it when the server sends a hole. But the next commit e0953cb7 lets the user skip pre-zeroing, at which point the memset is required to avoid data corruption.