drop iscsi->is_reconnecting
iscsi->is_reconnecting != 0 is equal to iscsi->old_iscsi != NULL. Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
@@ -111,7 +111,6 @@ struct iscsi_context {
|
||||
int secneg_phase;
|
||||
int login_attempts;
|
||||
int is_loggedin;
|
||||
int is_reconnecting;
|
||||
int bind_interfaces_cnt;
|
||||
int nops_in_flight;
|
||||
|
||||
|
||||
@@ -344,7 +344,6 @@ static void iscsi_reconnect_cb(struct iscsi_context *iscsi _U_, int status,
|
||||
ISCSI_LOG(iscsi, 2, "reconnect was successful");
|
||||
|
||||
iscsi->pending_reconnect = 0;
|
||||
iscsi->is_reconnecting = 0;
|
||||
}
|
||||
|
||||
int iscsi_reconnect(struct iscsi_context *old_iscsi)
|
||||
@@ -366,7 +365,7 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (old_iscsi->is_reconnecting && !old_iscsi->pending_reconnect) {
|
||||
if (old_iscsi->old_iscsi && !old_iscsi->pending_reconnect) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -389,9 +388,6 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
|
||||
|
||||
ISCSI_LOG(old_iscsi, 2, "reconnect initiated");
|
||||
|
||||
old_iscsi->is_reconnecting = 1;
|
||||
iscsi->is_reconnecting = 1;
|
||||
|
||||
iscsi_set_targetname(iscsi, old_iscsi->target_name);
|
||||
|
||||
iscsi_set_header_digest(iscsi, old_iscsi->want_header_digest);
|
||||
|
||||
@@ -402,7 +402,7 @@ iscsi_which_events(struct iscsi_context *iscsi)
|
||||
{
|
||||
int events = iscsi->is_connected ? POLLIN : POLLOUT;
|
||||
|
||||
if (iscsi->pending_reconnect && iscsi->is_reconnecting &&
|
||||
if (iscsi->pending_reconnect && iscsi->old_iscsi &&
|
||||
time(NULL) < iscsi->next_reconnect) {
|
||||
return 0;
|
||||
}
|
||||
@@ -779,7 +779,7 @@ iscsi_service_reconnect_if_loggedin(struct iscsi_context *iscsi)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (iscsi->is_reconnecting) {
|
||||
if (iscsi->old_iscsi) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
@@ -796,7 +796,7 @@ iscsi_service(struct iscsi_context *iscsi, int revents)
|
||||
if (time(NULL) >= iscsi->next_reconnect) {
|
||||
return iscsi_reconnect(iscsi);
|
||||
} else {
|
||||
if (iscsi->is_reconnecting) {
|
||||
if (iscsi->old_iscsi) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ reconnect_event_loop(struct iscsi_context *iscsi, struct iscsi_sync_state *state
|
||||
{
|
||||
struct pollfd pfd;
|
||||
int ret;
|
||||
while (iscsi->is_reconnecting) {
|
||||
while (iscsi->old_iscsi) {
|
||||
pfd.fd = iscsi_get_fd(iscsi);
|
||||
pfd.events = iscsi_which_events(iscsi);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user