Displaying 20 results from an estimated 300 matches similar to: "[PATCH nbdkit] server: Remove tricksy initialization of struct b_conn_handle."
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
Also add an inline accessor function (get_handle).
This also removes the unused function connection_get_handle.
---
server/internal.h | 24 ++++++++++++++++-----
server/backend.c | 50 ++++++++++++++++++++++----------------------
server/connections.c | 11 +---------
3 files changed, 45 insertions(+), 40 deletions(-)
diff --git a/server/internal.h b/server/internal.h
index
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
We don't know how long a plugin's .get_size() will take, but we also
documented that it shouldn't change per connection and therefore can
be cached. It's not hard to see that we have to consult the size per
connection (see commit b3a43ccd for a test that purposefully exposes
different sizes to separate clients), nor to search the code to see we
already cache it at the protocol
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
Similar to the previous patch in caching size, we want to avoid
calling into the plugin more than once per connection on any of the
flag determination callbacks.
The following script demonstrates the speedup, where we avoid repeated
calls into a slow can_fua. Pre-patch:
$ cat script
case "$1" in
get_size) echo 1m;;
can_fua) sleep 1; echo native;;
can_write | can_zero |
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
It's confusing to use the same terminology for a single backend as for
the linked list of backends. In particular it's often not clear if
we're calling the next backend or the whole chain of backends.
---
server/internal.h | 14 ++++++++++--
server/connections.c | 20 ++++++++---------
server/locks.c | 2 +-
server/main.c
2019 Oct 07
0
[nbdkit PATCH 5/5] server: Ensure .finalize and .close are called as needed
The retry filter was originally written to be the closest filter to
the plugin, with no other filters in between; as such, the reopen
command did not have to worry about recursion or about .prepare or
.finalize. But it is not that much harder to properly track
everything needed to allow other filters to be retried, as long as we
are careful to never call .finalize unless .prepare succeeded, never
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
Since commit 86fdb48c6a5362d66865493d9d2172166f99722e we have stored
the connection object in thread-local storage.
In this very large, but mostly mechanical change we stop passing the
connection pointer around everywhere, and instead use the value stored
in thread-local storage.
This assumes a 1-1 mapping between the connection and the current
thread which is true in *most* places.
2019 Apr 24
0
[nbdkit PATCH 1/4] server: Check for pthread lock failures
Low-level pthread locks should not fail except in extreme cases of
programmer bugs; we're better off calling attention to such bugs
rather than just assuming that they work and continuing on with
possibly inconsistent state.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
server/connections.c | 20 ++++++++++++--------
server/locks.c | 42
2018 Jan 17
0
[PATCH 5/9] connections: Allow multiple handles to be stored in the connection object.
Previously only one handle could be stored, but we will need to store
multiple handles when we have filters.
The plugin handle is defined as index 0. Filters will use indices > 0.
---
src/connections.c | 37 ++++++++++++++++++++++++++++++-------
src/internal.h | 4 ++--
src/plugins.c | 53 +++++++++++++++++++++++++++--------------------------
3 files changed, 59 insertions(+), 35
2018 Jan 19
0
[nbdkit PATCH v2 08/13] connections: Allow multiple handles to be stored in the connection object.
From: "Richard W.M. Jones" <rjones@redhat.com>
Previously only one handle could be stored, but we will need to store
multiple handles when we have filters.
The plugin handle is defined as index 0. Filters will use indices > 0.
Message-Id: <20180117205356.8699-6-rjones@redhat.com>
[eblake: rework for FUA support]
Signed-off-by: Eric Blake <eblake@redhat.com>
---
2017 Nov 17
0
[nbdkit PATCH 6/6] Add --threads option for supporting true parallel requests
It's finally time to implement one of the TODO items: we want to
support a thread pool of parallel readers from the client, in
order to allow multiple in-flight operations with potential
out-of-order completion. We also need at least one plugin that
supports parallel processing for testing the option; the file
plugin fits the bill.
Add and document a new command line option, -t/--threads=N,
2019 Sep 19
0
[PATCH nbdkit v2 1/4] server: Replace another memset with a call to reset_b_conn_handle.
Updates commit 5cdf4d6c89bdb802be234f2fccc8157b7228b546
and commit a6b88b195a959b17524d1c8353fd425d4891dc5f.
---
server/backend.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/server/backend.c b/server/backend.c
index 64dbf7d..6c102f9 100644
--- a/server/backend.c
+++ b/server/backend.c
@@ -209,8 +209,7 @@ backend_close (struct backend *b, struct connection *conn)
debug
2019 Aug 30
0
[nbdkit PATCH 9/9] server: Move command validation from protocol.c to backend.c
Now instead of validating just the client's request, we are validating
that all filters are passing valid requests on down.
In protocol.c, we were able to assert that our computation of eflags
populated all of the flags, and thus calls such as backend_can_write
would not fail; however, with filters, keeping those assertions mean
the burden is now on the filter to avoid calling into
2019 Nov 02
2
[PATCH nbdkit] server: Use GCC hints to move debug and error handling code out of hot paths.
For GCC only, define unlikely() macro. Use it on error paths to move
code out of the hot path.
In the server only, use the debug() macro (don't call nbdkit_debug
directly). This macro checks the verbose flag and moves the call to
nbdkit_debug out of the hot path.
---
server/connections.c | 11 ++++++-----
server/internal.h | 17 ++++++++++++++++-
server/plugins.c | 2 +-
2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
Mostly code motion.
---
src/Makefile.am | 1 +
src/connections.c | 14 +++----
src/internal.h | 14 ++++---
src/locks.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/plugins.c | 77 +++++-------------------------------
5 files changed, 142 insertions(+), 79 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 12b9043..1f05eab 100644
---
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
Mostly code motion.
---
src/Makefile.am | 1 +
src/connections.c | 14 +++----
src/internal.h | 14 ++++---
src/locks.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/plugins.c | 77 +++++-------------------------------
5 files changed, 142 insertions(+), 79 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 12b9043..1f05eab 100644
---
2019 Sep 19
1
Re: [PATCH nbdkit v3 1/3] filters: Implement next_ops .reopen call.
On 9/19/19 10:26 AM, Richard W.M. Jones wrote:
> This is intended for use by the forthcoming retry filter to close and
> reopen the backend chain. It is handled entirely by server/backend.c
> as no cooperation is needed with the plugin.
>
> Note the explicit readonly parameter: An alternative would be to store
> the previous readonly setting in the b_conn_handle struct.
2019 Sep 10
0
[PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
This allows plugins (or filters) to read the export name which was
passed to the server from the client.
UNFINISHED:
- Needs tests
---
TODO | 8 ++++++
docs/nbdkit-plugin.pod | 39 ++++++++++++++++++++++++++++
server/connections.c | 1 +
server/internal.h | 1 +
server/protocol-handshake-newstyle.c | 30
2019 Sep 19
0
[nbdkit PATCH 1/4] server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the same name, or more
interestingly, info on a different name), as a patch against qemu
commit 6f214b30445:
| diff --git
2019 Sep 19
0
[PATCH nbdkit v3 1/3] filters: Implement next_ops .reopen call.
This is intended for use by the forthcoming retry filter to close and
reopen the backend chain. It is handled entirely by server/backend.c
as no cooperation is needed with the plugin.
Note the explicit readonly parameter: An alternative would be to store
the previous readonly setting in the b_conn_handle struct. However
passing it explicitly allows the retry filter to retry as readonly,
which
2018 Jan 17
0
[PATCH 4/9] backend: Add a .plugin_name method.
This returns the plugin name, which for plugins is the same as the
ordinary .name method (but for filters will be different).
---
src/connections.c | 4 ++--
src/internal.h | 1 +
src/plugins.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/connections.c b/src/connections.c
index 921a5b2..e1ac543 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -221,7