search for: backend_can_fua

Displaying 19 results from an estimated 19 matches for "backend_can_fua".

2019 Aug 30
1
Re: [nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...t; * nbdkit_set_error() or relied on errno. */ > @@ -246,7 +271,7 @@ handle_request (struct connection *conn, > break; > > case NBD_CMD_WRITE: > - if (fua) > + if (flags & NBD_CMD_FLAG_FUA) > f |= NBDKIT_FLAG_FUA; So don't we need to keep the backend_can_fua() test here and later in this function? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...onnection *conn) { + struct b_conn_handle *h = &conn->handles[b->i]; + debug ("%s: can_extents", b->name); - return b->can_extents (b, conn); + if (h->can_extents == -1) + h->can_extents = b->can_extents (b, conn); + return h->can_extents; } int backend_can_fua (struct backend *b, struct connection *conn) { + struct b_conn_handle *h = &conn->handles[b->i]; + int r; + debug ("%s: can_fua", b->name); - return b->can_fua (b, conn); + if (h->can_fua == -1) { + r = backend_can_write (b, conn); + if (r != 1) { +...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...tion *conn) - __attribute__((__nonnull__ (1, 2))); -extern int backend_can_fast_zero (struct backend *b, struct connection *conn) - __attribute__((__nonnull__ (1, 2))); -extern int backend_can_extents (struct backend *b, struct connection *conn) - __attribute__((__nonnull__ (1, 2))); -extern int backend_can_fua (struct backend *b, struct connection *conn) - __attribute__((__nonnull__ (1, 2))); -extern int backend_can_multi_conn (struct backend *b, struct connection *conn) - __attribute__((__nonnull__ (1, 2))); -extern int backend_can_cache (struct backend *b, struct connection *conn) - __attribute__((_...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html v2 replaces struct connection *conn = GET_CONN; with GET_CONN; which sets conn implicitly and asserts that it is non-NULL. If we actually want to test if conn is non-NULL or behave differently, then you must use threadlocal_get_conn() instead, and some existing uses do that. Rich.
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of passing around struct connection * entirely within the server, preferring instead to reference the connection through thread-local storage. I hope this is a gateway to simplifying other parts of the code. Rich.
2020 Feb 12
0
[PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...(b_next); } static int next_can_extents (void *nxdata) { - struct b_h *b_h = nxdata; - return backend_can_extents (b_h->b); + struct backend *b_next = nxdata; + return backend_can_extents (b_next); } static int next_can_fua (void *nxdata) { - struct b_h *b_h = nxdata; - return backend_can_fua (b_h->b); + struct backend *b_next = nxdata; + return backend_can_fua (b_next); } static int next_can_multi_conn (void *nxdata) { - struct b_h *b_h = nxdata; - return backend_can_multi_conn (b_h->b); + struct backend *b_next = nxdata; + return backend_can_multi_conn (b_next); }...
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
...ast_zero (backend); + fl = backend_can_fast_zero (top); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_FAST_ZERO; - fl = backend_can_trim (backend); + fl = backend_can_trim (top); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_TRIM; - fl = backend_can_fua (backend); + fl = backend_can_fua (top); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_FUA; - fl = backend_can_flush (backend); + fl = backend_can_flush (top); if (fl == -1) return -1; if (fl) eflags |= NBD_FLAG_SEND_FLUSH; - fl = backend_is_rotati...
2019 Aug 30
3
[nbdkit PATCH v2 0/2] caching .can_write
This is a subset of the last half of the larger 9-patch series. The uncontroversial first half of that series is pushed, but here, I tried to reduce the size of the patches by splitting out some of the more complex changes, so that the rest of the changes remaining in the series are more mechanical. In turn, it forced me to write timing tests, which let me spot another spot where we are wasting
2019 Aug 30
15
[nbdkit PATCH 0/9] can_FOO caching, more filter validation
It's easy to use the sh script to demonstrate that nbdkit is inefficiently calling into .get_size, .can_fua, and friends more than necessary. We've also commented on the list in the past that it would be nice to ensure that when filters call into next_ops, they are not violating constraints (as we've have to fix several bugs in the past where we did not have such checking to protect
2020 Feb 12
2
[nbdkit PATCH] filters: Remove most next_* wrappers
...struct backend *b_next = nxdata; - return backend_can_fast_zero (b_next); -} - -static int -next_can_extents (void *nxdata) -{ - struct backend *b_next = nxdata; - return backend_can_extents (b_next); -} - -static int -next_can_fua (void *nxdata) -{ - struct backend *b_next = nxdata; - return backend_can_fua (b_next); -} - -static int -next_can_multi_conn (void *nxdata) -{ - struct backend *b_next = nxdata; - return backend_can_multi_conn (b_next); -} - -static int -next_can_cache (void *nxdata) -{ - struct backend *b_next = nxdata; - return backend_can_cache (b_next); -} - -static int -next_pread...
2020 Aug 06
2
[PATCH nbdkit] Experiment with parallel python plugin
...+ b/server/plugins.c @@ -631,6 +631,8 @@ plugin_zero (struct backend *b, void *handle, bool fast_zero = flags & NBDKIT_FLAG_FAST_ZERO; bool emulate = false; bool need_flush = false; + void *zero_buffer = NULL; + int buffer_size = MIN (MAX_REQUEST_SIZE, count); if (fua && backend_can_fua (b) != NBDKIT_FUA_NATIVE) { flags &= ~NBDKIT_FLAG_FUA; @@ -669,19 +671,25 @@ plugin_zero (struct backend *b, void *handle, threadlocal_set_error (0); *err = 0; + *err = posix_memalign(&zero_buffer, 4096, buffer_size); + if (*err != 0) { + r = -1; + goto done; + } +...
2019 Oct 04
6
[nbdkit PATCH 0/5] Another round of retry fixes
I still don't have .prepare/.finalize working cleanly across reopen, but did find a nasty bug where a botched assertion means we failed to notice reads beyond EOF in both the xz and retry filter. Refactoring backend.c will make .finalize work easier. Eric Blake (5): xz: Avoid reading beyond EOF retry: Check size before transactions tests: Test retry when get_size values change
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
..., b->name); @@ -410,7 +410,7 @@ int backend_can_extents (struct backend *b) { GET_CONN; - struct b_conn_handle *h = &conn->handles[b->i]; + struct handle *h = get_handle (conn, b->i); controlpath_debug ("%s: can_extents", b->name); @@ -424,7 +424,7 @@ int backend_can_fua (struct backend *b) { GET_CONN; - struct b_conn_handle *h = &conn->handles[b->i]; + struct handle *h = get_handle (conn, b->i); int r; controlpath_debug ("%s: can_fua", b->name); @@ -445,7 +445,7 @@ int backend_can_multi_conn (struct backend *b) { GET_CO...
2019 Aug 30
0
[nbdkit PATCH 9/9] server: Move command validation from protocol.c to backend.c
...cation was not negotiated", + name_of_nbd_cmd (cmd)); + *error = EINVAL; return false; } break; @@ -144,79 +137,6 @@ validate_request (struct connection *conn, *error = EINVAL; return false; } - if (flags & NBD_CMD_FLAG_FUA) { - r = backend_can_fua (backend, conn); - assert (r >= 0); /* Guaranteed by eflags computation */ - if (!r) { - nbdkit_error ("invalid request: FUA flag not supported"); - *error = EINVAL; - return false; - } - } - - /* Refuse over-large read and write requests. */ - if ((cmd == NB...
2020 Aug 06
0
[PATCH nbdkit] Experiment with parallel python plugin
...+ b/server/plugins.c @@ -631,6 +631,8 @@ plugin_zero (struct backend *b, void *handle, bool fast_zero = flags & NBDKIT_FLAG_FAST_ZERO; bool emulate = false; bool need_flush = false; + void *zero_buffer = NULL; + int buffer_size = MIN (MAX_REQUEST_SIZE, count); if (fua && backend_can_fua (b) != NBDKIT_FUA_NATIVE) { flags &= ~NBDKIT_FLAG_FUA; @@ -669,19 +671,25 @@ plugin_zero (struct backend *b, void *handle, threadlocal_set_error (0); *err = 0; + *err = posix_memalign(&zero_buffer, 4096, buffer_size); + if (*err != 0) { + r = -1; + goto done; + } +...
2020 Aug 06
0
Re: [PATCH nbdkit] Experiment with parallel python plugin
...,8 @@ plugin_zero (struct backend *b, void *handle, > bool fast_zero = flags & NBDKIT_FLAG_FAST_ZERO; > bool emulate = false; > bool need_flush = false; > + void *zero_buffer = NULL; > + int buffer_size = MIN (MAX_REQUEST_SIZE, count); > > if (fua && backend_can_fua (b) != NBDKIT_FUA_NATIVE) { > flags &= ~NBDKIT_FLAG_FUA; > @@ -669,19 +671,25 @@ plugin_zero (struct backend *b, void *handle, > threadlocal_set_error (0); > *err = 0; > > + *err = posix_memalign(&zero_buffer, 4096, buffer_size); > + if (*err != 0) { >...
2020 Feb 11
1
[nbdkit PATCH] filters: Make nxdata persistent
...t b_conn *nxdata = handle; + assert (nxdata->b == b->next && nxdata->conn == conn); if (f->filter.can_fua) - return f->filter.can_fua (&next_ops, &nxdata, handle); + return f->filter.can_fua (&next_ops, nxdata, nxdata->handle); else return backend_can_fua (b->next, conn); } @@ -554,10 +585,11 @@ static int filter_can_multi_conn (struct backend *b, struct connection *conn, void *handle) { struct backend_filter *f = container_of (b, struct backend_filter, backend); - struct b_conn nxdata = { .b = b->next, .conn = conn }; + struct b_conn...
2019 Oct 07
6
[nbdkit PATCH 0/5] More retry fixes
I think this is my last round of patches for issues I identified with the retry filter. With this in place, it should be safe to interject another filter in between retry and the plugin. Eric Blake (5): retry: Don't call into closed plugin tests: Refactor test-retry-reopen-fail.sh tests: Enhance retry test to cover failed reopen server: Move prepare/finalize/close recursion to
2019 Dec 12
9
[PATCH nbdkit 0/7] server: Allow datapath debug messages to be suppressed.
The immediate reason for this patch is to reduce the amount of debugging in virt-v2v with using the virt-v2v -v option (because this implies running nbdkit in verbose mode too). Most of the messages are datapath ones about pread/pwrite requests, and in fact as we've added more filters on top of nbdkit these messages have got more and more verbose. However they are not particularly