Skip to content

Commit

Permalink
Merge pull request #429 from raywang-dev/reset-next-reconnect
Browse files Browse the repository at this point in the history
feat: add iscsi_reset_next_reconnect interface
  • Loading branch information
sahlberg authored Nov 1, 2024
2 parents f5b7a6d + 29e626c commit 758e09e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/iscsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,11 @@ EXTERN int iscsi_force_reconnect(struct iscsi_context *iscsi);
*/
EXTERN int iscsi_force_reconnect_sync(struct iscsi_context *iscsi);

/*
* Reset iscsi auto reconnect next_reconnect time to the current time.
*/
EXTERN void iscsi_reset_next_reconnect(struct iscsi_context *iscsi);

/*
* Asynchronous call to perform an ISCSI login.
*
Expand Down
6 changes: 6 additions & 0 deletions lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,9 @@ int iscsi_force_reconnect(struct iscsi_context *iscsi)
{
return reconnect(iscsi, 1);
}

void iscsi_reset_next_reconnect(struct iscsi_context *iscsi)
{
ISCSI_LOG(iscsi, 1, "reset iscsi next_reconnect");
iscsi->next_reconnect = time(NULL);
}
1 change: 1 addition & 0 deletions lib/libiscsi.def
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ iscsi_extended_copy_task
iscsi_receive_copy_results_sync
iscsi_receive_copy_results_task
iscsi_reconnect
iscsi_reset_next_reconnect
iscsi_sanitize_sync
iscsi_sanitize_task
iscsi_sanitize_block_erase_sync
Expand Down
1 change: 1 addition & 0 deletions lib/libiscsi.syms.in
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ iscsi_reportluns_sync
iscsi_reportluns_task
iscsi_reserve6_sync
iscsi_reserve6_task
iscsi_reset_next_reconnect
iscsi_sanitize_block_erase_sync
iscsi_sanitize_block_erase_task
iscsi_sanitize_crypto_erase_sync
Expand Down

0 comments on commit 758e09e

Please sign in to comment.