search for: connection_get_request_lock

Displaying 16 results from an estimated 16 matches for "connection_get_request_lock".

2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
...D_MODEL_SERIALIZE_ALL_REQUESTS) { + debug ("acquire global request lock"); + pthread_mutex_lock (&all_requests_lock); + } + + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) { + debug ("acquire per-connection request lock"); + pthread_mutex_lock (connection_get_request_lock (conn)); + } + + debug ("acquire unload prevention lock"); + pthread_rwlock_rdlock (&unload_prevention_lock); +} + +void +unlock_request (struct connection *conn) +{ + int thread_model = plugin_thread_model (); + + debug ("release unload prevention lock"); + pthread_rw...
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
...D_MODEL_SERIALIZE_ALL_REQUESTS) { + debug ("acquire global request lock"); + pthread_mutex_lock (&all_requests_lock); + } + + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) { + debug ("acquire per-connection request lock"); + pthread_mutex_lock (connection_get_request_lock (conn)); + } + + debug ("acquire unload prevention lock"); + pthread_rwlock_rdlock (&unload_prevention_lock); +} + +void +unlock_request (struct connection *conn) +{ + int thread_model = plugin_thread_model (); + + debug ("release unload prevention lock"); + pthread_rw...
2018 Jun 06
2
[PATCH nbdkit] locks: Remove debugging messages about
The messages are not really useful to us, but they do bloat the debugging output of virt-v2v massively: nbdkit: python[1]: debug: acquire global request lock nbdkit: python[1]: debug: acquire per-connection request lock nbdkit: python[1]: debug: acquire unload prevention lock nbdkit: python[1]: debug: pwrite count=2097152 offset=4628414464 fua=0 nbdkit: python[1]: debug: release unload prevention
2018 Jun 06
0
[PATCH nbdkit] locks: Remove debugging messages about acquiring/releasing locks.
...RIALIZE_ALL_REQUESTS) pthread_mutex_lock (&all_requests_lock); - } - if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) { - debug ("acquire per-connection request lock"); + if (thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS) pthread_mutex_lock (connection_get_request_lock (conn)); - } - debug ("acquire unload prevention lock"); pthread_rwlock_rdlock (&unload_prevention_lock); } void unlock_request (struct connection *conn) { - debug ("release unload prevention lock"); pthread_rwlock_unlock (&unload_prevention_lock); -...
2017 Nov 14
0
[PATCH 2/3] Avoid race conditions when nbdkit exits.
...T_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) { debug ("acquire global request lock"); pthread_mutex_lock (&all_requests_lock); @@ -332,12 +334,16 @@ plugin_lock_request (struct connection *conn) debug ("acquire per-connection request lock"); pthread_mutex_lock (connection_get_request_lock (conn)); } + + debug ("acquire unload prevention lock"); + pthread_rwlock_rdlock (&unload_prevention_lock); } void plugin_unlock_request (struct connection *conn) { - assert (dl); + debug ("release unload prevention lock"); + pthread_rwlock_unlock (&unload_...
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here: https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html In v2 I have provided two patches: The first patch extends attribute((nonnull)) to most internal functions, but not to the external API. The second patch uses a macro so that attribute((format)) is only used in the public API on GCC or Clang. At least in theory these headers could be used by a C compiler which
2019 Jan 02
1
Re: [PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...; + uint64_t blknum, const uint8_t *block, > + uint32_t flags, int *err) > + __attribute__((__nonnull__ (1, 2, 4, 6))); Same comment; probably repeats elsewhere in the patch. > +++ b/server/internal.h > +extern pthread_mutex_t *connection_get_request_lock (struct connection *conn) > + __attribute__((__nonnull__ (1))); > +extern void connection_set_crypto_session (struct connection *conn, > + void *session) > + __attribute__((__nonnull__ (1 /* not 2 */))); > +extern void *connection_get_crypt...
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are called. This patch is in preparation for adding a second backend subtype for filters. Rich.
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...t connection *) + __attribute__((__nonnull__ (1))); extern int handle_single_connection (int sockin, int sockout); -extern int connection_set_handle (struct connection *conn, size_t i, void *handle); -extern void *connection_get_handle (struct connection *conn, size_t i); -extern pthread_mutex_t *connection_get_request_lock (struct connection *conn); -extern void connection_set_crypto_session (struct connection *conn, void *session); -extern void *connection_get_crypto_session (struct connection *conn); -extern void connection_set_recv (struct connection *, connection_recv_function); -extern void connection_set_send (...
2018 Jan 17
0
[PATCH 5/9] connections: Allow multiple handles to be stored in the connection object.
...n_set_handle (struct connection *conn, void *handle); -extern void *connection_get_handle (struct connection *conn); +extern int connection_set_handle (struct connection *conn, size_t i, void *handle); +extern void *connection_get_handle (struct connection *conn, size_t i); extern pthread_mutex_t *connection_get_request_lock (struct connection *conn); extern void connection_set_crypto_session (struct connection *conn, void *session); extern void *connection_get_crypto_session (struct connection *conn); diff --git a/src/plugins.c b/src/plugins.c index f0fe864..e732587 100644 --- a/src/plugins.c +++ b/src/plugins.c @@...
2018 Jan 19
0
[nbdkit PATCH v2 08/13] connections: Allow multiple handles to be stored in the connection object.
...n_set_handle (struct connection *conn, void *handle); -extern void *connection_get_handle (struct connection *conn); +extern int connection_set_handle (struct connection *conn, size_t i, void *handle); +extern void *connection_get_handle (struct connection *conn, size_t i); extern pthread_mutex_t *connection_get_request_lock (struct connection *conn); extern void connection_set_crypto_session (struct connection *conn, void *session); extern void *connection_get_crypto_session (struct connection *conn); diff --git a/src/plugins.c b/src/plugins.c index 4442a50..137bae3 100644 --- a/src/plugins.c +++ b/src/plugins.c @@...
2017 Nov 14
7
[PATCH 0/3] Alternate way to avoid race conditions when nbdkit exits.
This fixes the race conditions for me, using the test described here: https://www.redhat.com/archives/libguestfs/2017-September/msg00226.html Rich.
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.
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 Jan 19
16
[nbdkit PATCH v2 00/13] Add filters + FUA support to nbdkit
A combination of the work that both Rich and I have been doing lately, where filters use only the new API with flags on every command that the client can send over the wire (we can then add support for more flags in nbdkit without having to add new callbacks, as NBD adds more flags upstream). Eric Blake (4): protocol: Split flags from cmd field in requests backend: Pass flags argument through