Displaying 2 results from an estimated 2 matches for "2fae10d".
2019 Jul 18
3
[libnbd PATCH 0/2] in_flight improvements
Noticed while thinking about the recent threads wondering if we need a
more efficient lookup from cookie back to command. Both of these fix
bugs, but are tricky enough that I'm posting for review.
Eric Blake (2):
lib: Decrement in_flight at response, not retirement
lib: Do O(1) rather than O(n) queue insertion
generator/states-issue-command.c | 2 ++
generator/states-reply.c |
2019 Jul 18
0
[libnbd PATCH 2/2] lib: Do O(1) rather than O(n) queue insertion
...h->cmds_done = *list;
+ if (h->cmds_done_tail)
+ h->cmds_done_tail->next = *list;
+ else {
+ assert (h->cmds_done == NULL);
+ h->cmds_done = *list;
+ }
+ h->cmds_done_tail = prev_cmd;
*list = NULL;
}
}
diff --git a/lib/aio.c b/lib/aio.c
index 2fae10d..8d7cb8d 100644
--- a/lib/aio.c
+++ b/lib/aio.c
@@ -81,6 +81,10 @@ nbd_unlocked_aio_command_completed (struct nbd_handle *h,
error = EIO;
/* Retire it from the list and free it. */
+ if (h->cmds_done_tail == cmd) {
+ assert (cmd->next == NULL);
+ h->cmds_done_tail = prev_cm...