Staging: hv: vmbus_drv: Introduce state in struct vmbus_channel to track util services
authorK. Y. Srinivasan <kys@microsoft.com>
Mon, 16 May 2011 13:44:35 +0000 (06:44 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 May 2011 20:36:50 +0000 (13:36 -0700)
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: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/channel_mgmt.c
drivers/staging/hv/hyperv.h

index e8c706c6c830c288d263d5d9ba82af9251100b5f..1021713ea4c0728e2766da1b504c3665a9f27171 100644 (file)
@@ -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);
 
index 56af1ecbf0e584b997cd2fa26cc8e0894c283dca..8b826a115443684d22930c60a0480a79c382fefa 100644 (file)
@@ -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;
        /*