search for: 2d6ad9d

Displaying 3 results from an estimated 3 matches for "2d6ad9d".

2019 May 22
0
[libnbd PATCH v2 2/5] commands: Allow for a command queue
...* STATE MACHINE */ { + READY: + conn->reached_ready = true; + if (conn->cmds_to_issue) + SET_NEXT_STATE (%ISSUE_COMMAND.START); + return 0; + DEAD: if (conn->sock) { conn->sock->ops->close (conn->sock); diff --git a/lib/internal.h b/lib/internal.h index 67bd52a..2d6ad9d 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -175,6 +175,9 @@ struct nbd_connection { /* Global flags from the server. */ uint16_t gflags; + /* True if we've ever reached the READY state. */ + bool reached_ready; + /* When issuing a command, the first list contains commands w...
2019 May 22
0
[libnbd PATCH v2 4/5] states: Allow in-flight read while writing next command
...NEXT_STATE (%^REPLY.START); + return 0; + ISSUE_COMMAND.FINISH: struct command_in_flight *cmd; + assert (!conn->wlen); assert (conn->cmds_to_issue != NULL); cmd = conn->cmds_to_issue; conn->cmds_to_issue = cmd->next; diff --git a/lib/internal.h b/lib/internal.h index 2d6ad9d..91c056c 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -185,6 +185,7 @@ struct nbd_connection { * acknowledge them. */ struct command_in_flight *cmds_to_issue, *cmds_in_flight, *cmds_done; + bool in_write_payload; }; struct meta_context { -- 2.20.1
2019 May 22
10
[libnbd PATCH v2 0/5] Avoid deadlock with in-flight commands
On v1, we discussed whether cmds_to_issue needed to be a list, since it never had more than one element. I played with the idea of making it a list, and allowing the client to queue up new commands regardless of whether the state machine is currently in READY. I also polished up the tmp demo into a bit more full-fledged example file, worth including since it also let me discover a hard-to-hit race