Displaying 20 results from an estimated 1000 matches similar to: "[PATCH] daemon: Move the useful 'is_zero' function into common code."
2017 Apr 19
4
[PATCH v2 0/2] daemon: Move the useful 'is_zero' function into common code.
v1 -> v2:
The first patch is the same (the pure refactoring), but in the second
patch I implement Eric Blake's suggested version.
Rich.
2017 Apr 19
1
Re: [PATCH] daemon: Move the useful 'is_zero' function into common code.
On Wed, Apr 19, 2017 at 09:35:16AM -0500, Eric Blake wrote:
> On 04/19/2017 09:17 AM, Richard W.M. Jones wrote:
> > This is largely a simple refactoring, but it combines another
> > definition of this function from virt-builder which had a slightly
> > different prototype.
> > ---
>
> > +/* Return true iff the buffer is all zero bytes.
> > + *
> > +
2017 Apr 19
0
Re: [PATCH] daemon: Move the useful 'is_zero' function into common code.
On 04/19/2017 09:17 AM, Richard W.M. Jones wrote:
> This is largely a simple refactoring, but it combines another
> definition of this function from virt-builder which had a slightly
> different prototype.
> ---
> +/* Return true iff the buffer is all zero bytes.
> + *
> + * Note that gcc is smart enough to optimize this properly:
> + *
2017 Apr 20
0
Re: [PATCH v2 0/2] daemon: Move the useful 'is_zero' function into common code.
On Wednesday, 19 April 2017 18:46:37 CEST Richard W.M. Jones wrote:
> v1 -> v2:
>
> The first patch is the same (the pure refactoring), but in the second
> patch I implement Eric Blake's suggested version.
LGTM -- can you please add Eric's text to the comment of is_zero, so
it is easier to remember why the 16-bytes trick is done?
Thanks,
--
Pino Toscano
2020 Jan 30
2
[PATCH libnbd] python: Add AIO buffer is_zero method.
Fast testing whether the AIO buffer (or regions within it) contain all
zeroes, which allows Python code to quickly do sparsification when
copying.
This includes the iszero.h header from nbdkit which is distributed
under a compatible license.
---
common/include/Makefile.am | 5 +--
common/include/iszero.h | 63 +++++++++++++++++++++++++++++++++++++
generator/generator | 17
2019 Aug 15
2
[nbdkit PATCH] data, memory: Optimize .zero > PAGE_SIZE
When sparse_array_zero() is used for a range larger than a page,
there's no need to waste time in memset() or is_zero() - we already
know the page will be free()d.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
Here's a fun one :)
common/sparse/sparse.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/common/sparse/sparse.c b/common/sparse/sparse.c
2020 Feb 18
1
Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
On 2/17/20 9:13 AM, Max Reitz wrote:
> Hi,
>
> It’s my understanding that without some is_zero infrastructure for QEMU,
> it’s impossible to implement this flag in qemu’s NBD server.
You're right that we may need some more infrastructure before being able
to decide when to report this bit in all cases. But for raw files, that
infrastructure already exists: does block_status at
2015 Jul 02
0
[PATCH] Fix various -Wformat problems.
Updating gnulib has caused -Wformat-signedness to be enabled. This
has revealed many problems in C format strings. The fixes here fall
into the following main categories:
- Using %d with an unsigned parameter.
- %x and %o expect an unsigned argument.
- uid_t and gid_t are unsigned on Linux. The safe way to print these
is to cast them to uintmax_t and then print then using the %ju
2015 Jul 02
0
[PATCH v2] Fix various -Wformat problems.
Updating gnulib has caused -Wformat-signedness to be enabled. This
has revealed many problems in C format strings. The fixes here fall
into the following main categories:
- Using %d with an unsigned parameter.
- %x and %o expect an unsigned argument.
- uid_t and gid_t are unsigned on Linux. The safe way to print these
is to cast them to uintmax_t and then print them using the %ju
2020 Jan 30
0
Re: [PATCH libnbd] python: Add AIO buffer is_zero method.
On 1/30/20 8:05 AM, Richard W.M. Jones wrote:
> Fast testing whether the AIO buffer (or regions within it) contain all
> zeroes, which allows Python code to quickly do sparsification when
> copying.
>
> This includes the iszero.h header from nbdkit which is distributed
> under a compatible license.
> ---
> common/include/Makefile.am | 5 +--
>
2020 Jan 30
0
Re: [PATCH libnbd] python: Add AIO buffer is_zero method.
On Thu, Jan 30, 2020 at 02:29:21PM +0000, Richard W.M. Jones wrote:
>On Thu, Jan 30, 2020 at 08:16:30AM -0600, Eric Blake wrote:
>> On 1/30/20 8:05 AM, Richard W.M. Jones wrote:
>> >Fast testing whether the AIO buffer (or regions within it) contain all
>> >zeroes, which allows Python code to quickly do sparsification when
>> >copying.
>> >
>>
2013 Oct 22
1
[PATCH 2/2] Discard unwritten ranges
---
pxzcat.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/pxzcat.c b/pxzcat.c
index 9bcdc36..55ccfc0 100644
--- a/pxzcat.c
+++ b/pxzcat.c
@@ -44,10 +44,11 @@
#include <sys/types.h>
#include <error.h>
#include <errno.h>
#include <getopt.h>
#include <pthread.h>
+#include <linux/falloc.h>
#include <lzma.h>
#define DEBUG
2020 Jan 30
1
Re: [PATCH libnbd] python: Add AIO buffer is_zero method.
On Thu, Jan 30, 2020 at 04:16:09PM +0100, Martin Kletzander wrote:
> I know this probably got answered somewhere, but I've never gotten
> any when asking myself. So let me use this opportunity.
>
> Because I really despise useless processes and duplicated
> information I always hated the way all the "mandatory" file headers.
> As far as I understand it's
2013 Oct 23
0
Re: [PATCH 1/2] Preallocate output file
On 10/22/2013 05:56 PM, Gabriel de Perthuis wrote:
> ---
> pxzcat.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/pxzcat.c b/pxzcat.c
> index 4ab8689..9bcdc36 100644
> --- a/pxzcat.c
> +++ b/pxzcat.c
> @@ -29,10 +29,11 @@
> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
> * OF THE USE OF THIS SOFTWARE,
2015 Feb 12
0
[PATCH 2/3] builder: Check HAVE_POSIX_FADVISE before using it
---
builder/pxzcat-c.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/builder/pxzcat-c.c b/builder/pxzcat-c.c
index 0bbd296..dec9cc2 100644
--- a/builder/pxzcat-c.c
+++ b/builder/pxzcat-c.c
@@ -214,8 +214,10 @@ pxzcat (value filenamev, value outputfilev, unsigned nr_threads)
unix_error (err, (char *) "ftruncate", outputfilev);
}
+#if defined HAVE_POSIX_FADVISE
/*
2013 Oct 22
2
[PATCH 1/2] Preallocate output file
---
pxzcat.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pxzcat.c b/pxzcat.c
index 4ab8689..9bcdc36 100644
--- a/pxzcat.c
+++ b/pxzcat.c
@@ -29,10 +29,11 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
#include <config.h>
2017 Oct 03
0
[PATCH v2 2/2] builder: Choose better weights in the planner.
---
builder/builder.ml | 84 +++++++++++++++++++++++++++++++++----------
common/mlutils/unix_utils-c.c | 27 ++++++++++++++
common/mlutils/unix_utils.ml | 3 ++
common/mlutils/unix_utils.mli | 4 +++
m4/guestfs_libraries.m4 | 1 +
5 files changed, 100 insertions(+), 19 deletions(-)
diff --git a/builder/builder.ml b/builder/builder.ml
index d8e625f68..fd19aa7d9 100644
---
2016 Apr 14
0
[PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.
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
2018 Aug 01
1
Re: [PATCH v2 nbdkit 5/6] Add truncate filter for truncating or extending the size of plugins.
On 08/01/2018 06:10 AM, Richard W.M. Jones wrote:
> This can truncate, extend, or round up/down to a multiple.
> ---
> common-rules.mk | 3 +-
> configure.ac | 1 +
> filters/offset/nbdkit-offset-filter.pod | 7 +-
> filters/partition/nbdkit-partition-filter.pod | 1 +
>
2014 Aug 08
3
[PATCH] daemon: add CLEANUP_CLOSE
Just call close on the specified fd, if valid.
---
daemon/daemon.h | 3 +++
daemon/guestfsd.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index fb74e91..0caad45 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -173,6 +173,7 @@ asprintf_nowarn (char **strp, const char *fmt, ...)
extern void cleanup_free (void *ptr);
extern void