From: K. Y. Srinivasan Date: Mon, 16 May 2011 13:44:35 +0000 (-0700) Subject: Staging: hv: vmbus_drv: Introduce state in struct vmbus_channel to track util services X-Git-Tag: v3.0-rc1~336^2~148 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=31bceb845e0f5393db1d9bf033d365cff7132c93;p=karo-tx-linux.git 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: K. Y. Srinivasan Signed-off-by: Haiyang Zhang Signed-off-by: Abhishek Kane Signed-off-by: Hank Janssen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c index e8c706c6c830..1021713ea4c0 100644 --- a/drivers/staging/hv/channel_mgmt.c +++ b/drivers/staging/hv/channel_mgmt.c @@ -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); diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h index 56af1ecbf0e5..8b826a115443 100644 --- a/drivers/staging/hv/hyperv.h +++ b/drivers/staging/hv/hyperv.h @@ -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; /*