Displaying 20 results from an estimated 87 matches for "backend_filter".
Did you mean:
backend_file
2020 Feb 11
1
[nbdkit PATCH] filters: Make nxdata persistent
...ver/filters.c
@@ -1,5 +1,5 @@
/* nbdkit
- * Copyright (C) 2013-2019 Red Hat Inc.
+ * Copyright (C) 2013-2020 Red Hat Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -49,12 +49,14 @@ struct backend_filter {
struct nbdkit_filter filter;
};
-/* Literally a backend + a connection pointer. This is the
- * implementation of ‘void *nxdata’ in the filter API.
+/* Literally a backend, a connection pointer, and the filter's handle.
+ * This is the implementation of our handle in .open, and serves a...
2020 Feb 12
0
[PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...ary/msg00092.html
---
server/filters.c | 217 ++++++++++++++++-------------------------------
1 file changed, 73 insertions(+), 144 deletions(-)
diff --git a/server/filters.c b/server/filters.c
index c916217c..92b0ceb3 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -49,16 +49,6 @@ struct backend_filter {
struct nbdkit_filter filter;
};
-/* Literally a backend and the filter's handle.
- *
- * This is the implementation of our handle in .open, and serves as
- * a stable ‘void *nxdata’ in the filter API.
- */
-struct b_h {
- struct backend *b;
- void *handle;
-};
-
/* Note this frees th...
2019 Aug 30
0
[nbdkit PATCH 1/9] server: Fewer dereferences in filter
...s.c | 170 ++++++++++++++++++++++-------------------------
1 file changed, 79 insertions(+), 91 deletions(-)
diff --git a/server/filters.c b/server/filters.c
index bb6394fb..287c8747 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -68,7 +68,7 @@ filter_free (struct backend *b)
{
struct backend_filter *f = container_of (b, struct backend_filter, backend);
- f->backend.next->free (f->backend.next);
+ b->next->free (b->next);
/* Acquiring this lock prevents any filter callbacks from running
* simultaneously.
@@ -94,7 +94,7 @@ filter_thread_model (struct backend *b)
{...
2018 Jan 17
0
[PATCH 7/9] Implement filters.
...;string.h>
+#include <inttypes.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <dlfcn.h>
+
+#include "nbdkit-filter.h"
+#include "internal.h"
+
+/* We extend the generic backend struct with extra fields relating
+ * to this filter.
+ */
+struct backend_filter {
+ struct backend backend;
+ char *filename;
+ void *dl;
+ struct nbdkit_filter filter;
+};
+
+/* Note this frees the whole chain. */
+static void
+filter_free (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+
+ f->backend.next->fre...
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
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...;string.h>
+#include <inttypes.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <dlfcn.h>
+
+#include "nbdkit-filter.h"
+#include "internal.h"
+
+/* We extend the generic backend struct with extra fields relating
+ * to this filter.
+ */
+struct backend_filter {
+ struct backend backend;
+ char *filename;
+ void *dl;
+ struct nbdkit_filter filter;
+};
+
+/* Note this frees the whole chain. */
+static void
+filter_free (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+
+ f->backend.next->fre...
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...;string.h>
+#include <inttypes.h>
+#include <assert.h>
+#include <errno.h>
+
+#include <dlfcn.h>
+
+#include "nbdkit-filter.h"
+#include "internal.h"
+
+/* We extend the generic backend struct with extra fields relating
+ * to this filter.
+ */
+struct backend_filter {
+ struct backend backend;
+ char *filename;
+ void *dl;
+ struct nbdkit_filter filter;
+};
+
+/* Literally a backend + a connection pointer. This is the
+ * implementation of ‘void *nxdata’ in the filter API.
+ */
+struct b_conn {
+ struct backend *b;
+ struct connection *conn;
+};
+
+/* N...
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 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 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...*conn, int sockin, int sockout)
+crypto_negotiate_tls (int sockin, int sockout)
{
/* Should never be called because tls == 0. */
abort ();
diff --git a/server/filters.c b/server/filters.c
index 2f65818e..c916217c 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -49,13 +49,13 @@ struct backend_filter {
struct nbdkit_filter filter;
};
-/* Literally a backend, a connection pointer, and the filter's handle.
+/* Literally a backend and the filter's handle.
+ *
* This is the implementation of our handle in .open, and serves as
* a stable ‘void *nxdata’ in the filter API.
*/
-stru...
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.
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
2018 Aug 01
0
[PATCH v2 nbdkit 3/6] filters: Print filter name in debugging messages.
...ct backend *b)
*/
lock_unload ();
- debug ("%s: unload", f->filename);
+ debug ("%s: unload", f->name);
if (f->filter.unload)
f->filter.unload ();
@@ -172,7 +172,7 @@ filter_config (struct backend *b, const char *key, const char *value)
struct backend_filter *f = container_of (b, struct backend_filter, backend);
debug ("%s: config key=%s, value=%s",
- f->filename, key, value);
+ f->name, key, value);
if (f->filter.config) {
if (f->filter.config (next_config, f->backend.next, key, value) == -1)
@@...
2018 Jan 19
9
[PATCH nbdkit filters-v3 0/7] Introduce filters.
This is still tentative and needs a lot of work, but:
- partition filter works, supporting MBR & GPT
- prepare and finalize methods fixed
- open method can now be changed (allowing readonly flag to be modified)
- thread_model can be limited
I believe I made most of the changes which were previously suggested
in email. I think the only one I didn't was preventing inclusion of
both
2019 Aug 30
0
[nbdkit PATCH 2/9] server: Consolidate common backend tasks into new backend.c
...ad)
+ unload ();
+
+ if (DO_DLCLOSE)
+ dlclose (b->dl);
+ free (b->filename);
+
+ unlock_unload ();
+
+ free (b->name);
+}
diff --git a/server/filters.c b/server/filters.c
index 287c8747..1f76bf61 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -48,9 +48,6 @@
*/
struct backend_filter {
struct backend backend;
- char *name; /* copy of filter.name */
- char *filename;
- void *dl;
struct nbdkit_filter filter;
};
@@ -70,22 +67,7 @@ filter_free (struct backend *b)
b->next->free (b->next);
- /* Acquiring this lock prevents any filter callba...
2018 Jan 19
10
[PATCH nbdkit filters-v2 0/5] Introduce filters.
Rebased filters patch. Requires current git master + the locks /
thread model fix
(https://www.redhat.com/archives/libguestfs/2018-January/msg00128.html)
So a few changes here since last time:
The "introduce filters" and "implement filters" patches are
squashed together.
I introduced a concept of .prepare and .finalize. These run before
and after the data serving phase
2020 Feb 11
1
Re: [PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
..._INFO_INIT_STATE
stuff on top of it). Are we sure that there is not going to be a speed
penalty (from frequent access to the thread-local storage, compared to
previous access through a parameter stored in a register)?
A few comments:
> +++ b/server/filters.c
> @@ -49,13 +49,13 @@ struct backend_filter {
> struct nbdkit_filter filter;
> };
>
> -/* Literally a backend, a connection pointer, and the filter's handle.
> +/* Literally a backend and the filter's handle.
> + *
> * This is the implementation of our handle in .open, and serves as
> * a stable...
2018 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to:
https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html
"[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend"
The rest of the patches add filters using the new filter API
previously described here:
https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html
This needs a lot more testing -- and tests --
2018 Feb 01
0
[nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
...c
index 40c4913..1003dc7 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -107,14 +107,6 @@ filter_thread_model (struct backend *b)
/* These are actually passing through to the final plugin, hence
* the function names.
*/
-static int
-plugin_errno_is_preserved (struct backend *b)
-{
- struct backend_filter *f = container_of (b, struct backend_filter, backend);
-
- return f->backend.next->errno_is_preserved (f->backend.next);
-}
-
static const char *
plugin_name (struct backend *b)
{
@@ -463,17 +455,23 @@ filter_pread (struct backend *b, struct connection *conn,
struct backend_filter *...
2018 Jan 24
0
[nbdkit PATCH 2/3] filter: Add .can_zero/.can_fua overrides
...can_zero,
+ .can_fua = next_can_fua,
};
static int
@@ -455,6 +471,36 @@ filter_can_trim (struct backend *b, struct connection *conn)
return f->backend.next->can_trim (f->backend.next, conn);
}
+static int
+filter_can_zero (struct backend *b, struct connection *conn)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+ void *handle = connection_get_handle (conn, f->backend.i);
+ struct b_conn nxdata = { .b = f->backend.next, .conn = conn };
+
+ debug ("can_zero");
+
+ if (f->filter.can_zero)
+ return f->filter.can_zero (&nex...