nbd: Use nbdkit aio_*_notify variants
commit3f46cf205d66d06bf9e2d2fe780d3bb18ac4d616
authorEric Blake <eblake@redhat.com>
Mon, 1 Jul 2019 21:48:28 +0000 (1 16:48 -0500)
committerEric Blake <eblake@redhat.com>
Wed, 3 Jul 2019 18:20:00 +0000 (3 13:20 -0500)
treee54886ca63a3c8692468d4fab0041d9dbc5caecc
parent86e79a77092b3c6f84a02dc265a96ebb4b0ebd77
nbd: Use nbdkit aio_*_notify variants

We no longer have to track a linked list of in-flight transactions
that are pending resolution, but rely instead on libnbd 0.1.6+ doing
it on our behalf. Normally, we will get to call nbdplug_register()
prior to the notify callback being reached, but under a heavily-loaded
system, it is conceivable that the libnbd state machine can manage to
fire off our request and receive a server reply all before returning
to the thread waiting on the semaphore, in which case the notify
callback could set the cookie first.  We still have to call
nbd_aio_command_completed to retire the command, but now we can call
it from the context of the thread that made the request rather than
from the central reader thread, and we can check that the retired
command has the same status as expected from the notify callback.

Repeating a setup from commit e897ed70, I'm not seeing any real
difference in performance numbers. But the reduced lines of code, and
one less mutex, makes this seem like a win from the maintenance
persepective.

Signed-off-by: Eric Blake <eblake@redhat.com>
configure.ac
plugins/nbd/nbd.c