Displaying 10 results from an estimated 10 matches for "nozero_zero".
2019 Aug 13
0
[nbdkit PATCH 2/2] nozero: More efficient FUA handling
...filters/nozero/nozero.c
@@ -1,5 +1,5 @@
/* nbdkit
- * Copyright (C) 2018 Red Hat Inc.
+ * Copyright (C) 2018-2019 Red Hat Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -102,12 +102,22 @@ nozero_zero (struct nbdkit_next_ops *next_ops, void *nxdata,
void *handle, uint32_t count, uint64_t offs, uint32_t flags,
int *err)
{
+ int writeflags = 0;
+ bool need_flush = false;
+
assert (zeromode != NONE);
flags &= ~NBDKIT_FLAG_MAY_TRIM;
if (zeromode == NOTRIM...
2019 May 10
1
[nbdkit PATCH] nozero: Add notrim mode
...s plugin zero support");
+ return -1;
+ }
+ }
+ return 0;
+}
/* Advertise desired WRITE_ZEROES mode. */
static int
nozero_can_zero (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle)
{
- return emulate;
+ return zeromode != NONE;
}
static int
@@ -81,11 +105,15 @@ nozero_zero (struct nbdkit_next_ops *next_ops, void *nxdata,
void *handle, uint32_t count, uint64_t offs, uint32_t flags,
int *err)
{
- assert (emulate);
+ assert (zeromode != NONE);
+ flags &= ~NBDKIT_FLAG_MAY_TRIM;
+
+ if (zeromode == NOTRIM)
+ return next_ops->zero...
2019 Aug 13
3
[nbdkit PATCH 0/2] more fast zero prep
Another couple things I noticed that are worth improving, but aren't
strictly related to implementing fast zero support.
Eric Blake (2):
server: Assert sane error responses
nozero: More efficient FUA handling
filters/nozero/nozero.c | 17 +++++++++++--
server/filters.c | 56 +++++++++++++++++++++++++++++++++--------
server/protocol.c | 32 +++++++++++++++++------
3 files
2018 Jan 24
0
[nbdkit PATCH 3/3] filters: Add nozero filter
...r.h>
+
+#define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL
+
+/* Disable WRITE_ZEROES. */
+static int
+nozero_can_zero (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle)
+{
+ return 0;
+}
+
+/* Should never be reached (nbdkit should have already flagged a bad client). */
+static int
+nozero_zero (struct nbdkit_next_ops *next_ops, void *nxdata,
+ void *handle, uint32_t count, uint64_t offs, int may_trim)
+{
+ abort ();
+}
+
+static struct nbdkit_filter filter = {
+ .name = "nozero",
+ .longname = "nbdkit nozero filter",
+ .version...
2019 Jul 05
0
Re: [nbdkit] [filter/nozero] large binary size with GCC 9
...ters/nozero/nozero.c w/filters/nozero/nozero.c
index 16ec710b..21863707 100644
--- i/filters/nozero/nozero.c
+++ w/filters/nozero/nozero.c
@@ -45,7 +45,6 @@
#define MAX_WRITE (64 * 1024 * 1024)
-static const char buffer[MAX_WRITE];
static enum ZeroMode {
NONE,
EMULATE,
@@ -111,6 +110,8 @@ nozero_zero (struct nbdkit_next_ops *next_ops, void
*nxdata,
while (count) {
uint32_t size = MIN (count, MAX_WRITE);
+ static const char buffer[MAX_WRITE]; /* Always contains zeroes */
+
if (next_ops->pwrite (nxdata, buffer, size, offs, flags, err) == -1)
return -1;
offs += size...
2019 Jul 04
3
[nbdkit] [filter/nozero] large binary size with GCC 9
Hi all,
It seems GCC 9 does not put read-only zero-initialized variables into the BSS
section anymore; instead it is put into RODATA.
(See the thread at [0], especially [1])
In filter/nozero a 64M large, static, zeroed, read-only array is declared.
The new behavior of GCC puts this array as-is into the binary inflating the
size by a factor of around 10000.
(Clang 8 and older GCCs work
2018 Jan 24
8
[nbdkit PATCH 0/3] Add nozero filter
I still need to add testsuite coverage. Perhaps it might be easier
if I create a new '--filter=log logfile=foo' filter that produces
a log of which commands a client sent, then compare the log using
a known client that uses write_zeroes (qemu-io works well) both
with and without --filter=nozero to prove that the change in
advertisement changes the commands sent over the wire (that would
2019 Aug 30
1
[nbdkit PATCH v2] filters: Stronger version match requirements
...= noparallel_config,
.config_help = noparallel_config_help,
.thread_model = noparallel_thread_model,
diff --git a/filters/nozero/nozero.c b/filters/nozero/nozero.c
index 964cce9f..9187ec33 100644
--- a/filters/nozero/nozero.c
+++ b/filters/nozero/nozero.c
@@ -139,7 +139,6 @@ nozero_zero (struct nbdkit_next_ops *next_ops, void *nxdata,
static struct nbdkit_filter filter = {
.name = "nozero",
.longname = "nbdkit nozero filter",
- .version = PACKAGE_VERSION,
.config = nozero_config,
.config_help = noze...
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem
to four different projects:
- nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag
- qemu: Implement the flag for both clients and server
- libnbd: Implement the flag for clients
- nbdkit: Implement the flag for servers, including the nbd passthrough
client
If you want to test the patches together, I've pushed a
2018 Mar 08
19
[nbdkit PATCH v3 00/15] Add FUA support to nbdkit
After more than a month since v2 [1], I've finally got my FUA
support series polished. This is all of my outstanding patches,
even though some of them were originally posted in separate
threads from the original FUA post [2], [3]
[1] https://www.redhat.com/archives/libguestfs/2018-January/msg00113.html
[2] https://www.redhat.com/archives/libguestfs/2018-January/msg00219.html
[3]