Add a new "iscsi_queue_length()" which will tell us how many commands

are in flight at the moment.
Aside from commands, we also consider the "has not yet connected completely" as being an i/o.

When this command returns 0 it means we are connected ant the iscsi connection is idle, with no commands in flight.

KVM needs a function to detect idleness like this for its block layer io_flush
function.
This commit is contained in:
Ronnie Sahlberg
2011-02-03 19:08:16 +11:00
parent d22a2aee3c
commit c29b9a2aae
2 changed files with 23 additions and 0 deletions

View File

@@ -47,6 +47,10 @@ int iscsi_which_events(struct iscsi_context *iscsi);
* file descriptor.
*/
int iscsi_service(struct iscsi_context *iscsi, int revents);
/*
* How many commands are in flight.
*/
int iscsi_queue_length(struct iscsi_context *iscsi);