search for: nbdplug_prepare

Displaying 8 results from an estimated 8 matches for "nbdplug_prepare".

2019 Jul 17
3
[nbdkit PATCH 0/2] Another libnbd API bump
libnbd 0.1.7 was released today, which breaks compilation of nbdkit-nbd-plugin. We could work around it by using #ifdef LIBNBD_HAVE_XXX to learn about the renamed functions, but supporting older versions is not all that important when we don't yet have API stability. So patch 1 copes by just bumping the minimum version instead, except that we have yet another pending libnbd patch with an API
2019 Jul 17
0
[nbdkit PATCH 2/2] nbd: Another libnbd API bump
...[test "x$LIBNBD_LIBS" != "x"]) diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 48873d09..83a30583 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -673,7 +673,7 @@ nbdplug_pread (void *handle, void *buf, uint32_t count, uint64_t offset, assert (!flags); nbdplug_prepare (&s); nbdplug_register (h, &s, nbd_aio_pread_callback (h->nbd, buf, count, offset, - &s, nbdplug_notify, 0)); + nbdplug_notify, &s, 0)); return nbdplug_reply (h, &s); }...
2019 Jul 01
3
[nbdkit PATCH 0/2] Use new libnbd _notify functions
I'm not observing any noticeable performance differences, but I'm liking the diffstat. I can't push this patch until we release a new libnbd version with the _notify API addition, but am posting it now for playing with things. Eric Blake (2): nbd: Move transaction info from heap to stack nbd: Use nbdkit aio_*_notify variants plugins/nbd/nbd.c | 217
2019 Jul 01
0
[nbdkit PATCH 2/2] nbd: Use nbdkit aio_*_notify variants
...DOWN; - } - else if (!r) - trans->err = ESHUTDOWN; - if (sem_post (&trans->sem)) { - nbdkit_error ("failed to post semaphore: %m"); - abort (); - } - } nbdkit_debug ("exiting state machine thread"); return NULL; } @@ -411,6 +353,23 @@ nbdplug_prepare (struct transaction *trans) assert (false); } +static int +nbdplug_notify (void *opaque, int64_t cookie, int *error) +{ + struct transaction *trans = opaque; + + nbdkit_debug ("cookie %" PRId64 " completed state machine, status %d", + cookie, *error); +...
2019 Aug 15
3
[nbdkit PATCH] nbd: Another libnbd version bump
...;= 0 || tls_username || tls_psk) + ? LIBNBD_TLS_ALLOW : LIBNBD_TLS_DISABLE; + if (tls != LIBNBD_TLS_DISABLE) { struct nbd_handle *nbd = nbd_create (); if (!nbd) { @@ -345,23 +347,12 @@ nbdplug_reader (void *handle) return NULL; } -/* Prepare for a transaction. */ -static void -nbdplug_prepare (struct transaction *trans) -{ - memset (trans, 0, sizeof *trans); - if (sem_init (&trans->sem, 0, 0)) - assert (false); -} - +/* Callback used at end of a transaction. */ static int -nbdplug_notify (unsigned valid_flag, void *opaque, int *error) +nbdplug_notify (void *opaque, int *err...
2019 Jul 30
1
[PATCH nbdkit] nbd: Update for libnbd 0.9.6.
...iff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 2ddb2c0..e8bc779 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -57,6 +57,7 @@ /* The per-transaction details */ struct transaction { + int64_t cookie; sem_t sem; uint32_t early_err; uint32_t err; @@ -353,15 +354,19 @@ nbdplug_prepare (struct transaction *trans) } static int -nbdplug_notify (unsigned valid_flag, void *opaque, int64_t cookie, int *error) +nbdplug_notify (unsigned valid_flag, void *opaque, int *error) { struct transaction *trans = opaque; if (!(valid_flag & LIBNBD_CALLBACK_VALID)) return 0;...
2019 Aug 23
2
[nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook
...FLAG_MAY_TRIM)) f |= LIBNBD_CMD_FLAG_NO_HOLE; if (flags & NBDKIT_FLAG_FUA) f |= LIBNBD_CMD_FLAG_FUA; +#if LIBNBD_HAVE_NBD_CAN_FAST_ZERO + if (flags & NBDKIT_FLAG_FAST_ZERO) + f |= LIBNBD_CMD_FLAG_FAST_ZERO; +#else + assert (!(flags & NBDKIT_FLAG_FAST_ZERO)); +#endif nbdplug_prepare (&s); nbdplug_register (h, &s, nbd_aio_zero (h->nbd, count, offset, s.cb, f)); return nbdplug_reply (h, &s); @@ -831,6 +856,7 @@ static struct nbdkit_plugin plugin = { .is_rotational = nbdplug_is_rotational, .can_trim = nbdplug_can_trim, .can_zero...
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