Commit 31bceb84 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: vmbus_drv: Introduce state in struct vmbus_channel to track util services

In preparation for getting rid of util channel synchronization based on
counting util channels, introduce state in  struct vmbus_channel  to
track util services.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7e0b3bf3
......@@ -419,6 +419,7 @@ static void vmbus_process_offer(struct work_struct *work)
* can cleanup properly
*/
newchannel->state = CHANNEL_OPEN_STATE;
newchannel->util_index = -1; /* Invalid index */
/* Open IC channels */
for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) {
......@@ -430,6 +431,7 @@ static void vmbus_process_offer(struct work_struct *work)
hv_cb_utils[cnt].callback,
newchannel) == 0) {
hv_cb_utils[cnt].channel = newchannel;
newchannel->util_index = cnt;
pr_info("%s\n", hv_cb_utils[cnt].log_msg);
......
......@@ -532,6 +532,11 @@ struct vmbus_channel {
struct work_struct work;
enum vmbus_channel_state state;
/*
* For util channels, stash the
* the service index for easy access.
*/
s8 util_index;
struct vmbus_channel_offer_channel offermsg;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment