diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-14 19:57:54 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2022-04-26 13:16:39 -0500 |
commit | dba5156c0e9c0362b7c6121f9e1c89bb9be1f227 (patch) | |
tree | 926943dbe6f7b1248c10b30cc3ae0d77a7a58adf /module-common.c | |
parent | 8d45185cb76fa1dd7c3309940a967dc42d8619d4 (diff) |
nbd: move s->state under requests_lock
Remove the confusing, and most likely wrong, atomics. The only function
that used to be somewhat in a hot path was nbd_client_connected(),
but it is not anymore after the previous patches.
The same logic is used both to check if a request had to be reissued
and also in nbd_reconnecting_attempt(). The former cases are outside
requests_lock, while nbd_reconnecting_attempt() does have the lock,
therefore the two have been separated in the previous commit.
nbd_client_will_reconnect() can simply take s->requests_lock, while
nbd_reconnecting_attempt() can inline the access now that no
complicated atomics are involved.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220414175756.671165-8-pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'module-common.c')
0 files changed, 0 insertions, 0 deletions