Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235725
b: refs/heads/master
c: 15b2f64
h: refs/heads/master
i:
  235723: cc1cc5c
v: v3
  • Loading branch information
Haiyang Zhang authored and Greg Kroah-Hartman committed Jan 31, 2011
1 parent d79ab60 commit 6398fe2
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 127 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6238f21736af3f47bdebf3895f477f5f23f1af9
refs/heads/master: 15b2f6479b5c5220848ba159248665d56694d2f9
48 changes: 24 additions & 24 deletions trunk/drivers/staging/hv/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ static void vmbus_setevent(struct vmbus_channel *channel)
if (channel->offermsg.monitor_allocated) {
/* Each u32 represents 32 channels */
set_bit(channel->offermsg.child_relid & 31,
(unsigned long *) gVmbusConnection.SendInterruptPage +
(unsigned long *) vmbus_connection.SendInterruptPage +
(channel->offermsg.child_relid >> 5));

monitorpage = gVmbusConnection.MonitorPages;
monitorpage = vmbus_connection.MonitorPages;
monitorpage++; /* Get the child to parent monitor page */

set_bit(channel->monitor_bit,
Expand All @@ -100,11 +100,11 @@ static void VmbusChannelClearEvent(struct vmbus_channel *channel)
if (Channel->offermsg.monitor_allocated) {
/* Each u32 represents 32 channels */
clear_bit(Channel->offermsg.child_relid & 31,
(unsigned long *)gVmbusConnection.SendInterruptPage +
(unsigned long *)vmbus_connection.SendInterruptPage +
(Channel->offermsg.child_relid >> 5));

monitorPage =
(struct hv_monitor_page *)gVmbusConnection.MonitorPages;
(struct hv_monitor_page *)vmbus_connection.MonitorPages;
monitorPage++; /* Get the child to parent monitor page */

clear_bit(Channel->monitor_bit,
Expand Down Expand Up @@ -133,7 +133,7 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
&channel->offermsg.offer.InterfaceInstance,
sizeof(struct hv_guid));

monitorpage = (struct hv_monitor_page *)gVmbusConnection.MonitorPages;
monitorpage = (struct hv_monitor_page *)vmbus_connection.MonitorPages;

debuginfo->monitorid = channel->offermsg.monitorid;

Expand Down Expand Up @@ -265,10 +265,10 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
if (userdatalen)
memcpy(openMsg->userdata, userdata, userdatalen);

spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&openInfo->msglistentry,
&gVmbusConnection.ChannelMsgList);
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
&vmbus_connection.ChannelMsgList);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

DPRINT_DBG(VMBUS, "Sending channel open msg...");

Expand All @@ -289,9 +289,9 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
newchannel, openInfo->response.open_result.status);

Cleanup:
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_del(&openInfo->msglistentry);
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

kfree(openInfo->waitevent);
kfree(openInfo);
Expand Down Expand Up @@ -501,8 +501,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
unsigned long flags;
int ret = 0;

next_gpadl_handle = atomic_read(&gVmbusConnection.NextGpadlHandle);
atomic_inc(&gVmbusConnection.NextGpadlHandle);
next_gpadl_handle = atomic_read(&vmbus_connection.NextGpadlHandle);
atomic_inc(&vmbus_connection.NextGpadlHandle);

ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
if (ret)
Expand All @@ -521,11 +521,11 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,

dump_gpadl_header(gpadlmsg);

spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&msginfo->msglistentry,
&gVmbusConnection.ChannelMsgList);
&vmbus_connection.ChannelMsgList);

spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
DPRINT_DBG(VMBUS, "buffer %p, size %d msg cnt %d",
kbuffer, size, msgcount);

Expand Down Expand Up @@ -577,9 +577,9 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
*gpadl_handle = gpadlmsg->gpadl;

Cleanup:
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_del(&msginfo->msglistentry);
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

kfree(msginfo->waitevent);
kfree(msginfo);
Expand Down Expand Up @@ -616,10 +616,10 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
msg->child_relid = channel->offermsg.child_relid;
msg->gpadl = gpadl_handle;

spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_add_tail(&info->msglistentry,
&gVmbusConnection.ChannelMsgList);
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
&vmbus_connection.ChannelMsgList);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

ret = VmbusPostMessage(msg,
sizeof(struct vmbus_channel_gpadl_teardown));
Expand All @@ -631,9 +631,9 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
osd_waitevent_wait(info->waitevent);

/* Received a torndown response */
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
list_del(&info->msglistentry);
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);

kfree(info->waitevent);
kfree(info);
Expand Down Expand Up @@ -697,9 +697,9 @@ void vmbus_close(struct vmbus_channel *channel)
*/

if (channel->state == CHANNEL_OPEN_STATE) {
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
list_del(&channel->listentry);
spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);

free_channel(channel);
}
Expand Down
48 changes: 24 additions & 24 deletions trunk/drivers/staging/hv/channel_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void free_channel(struct vmbus_channel *channel)
* ie we can't destroy ourselves.
*/
INIT_WORK(&channel->work, release_channel);
queue_work(gVmbusConnection.WorkQueue, &channel->work);
queue_work(vmbus_connection.WorkQueue, &channel->work);
}


Expand All @@ -323,10 +323,10 @@ static void count_hv_channel(void)
static int counter;
unsigned long flags;

spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
if (++counter == MAX_MSG_TYPES)
complete(&hv_channel_ready);
spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
}

/*
Expand Down Expand Up @@ -361,9 +361,9 @@ static void vmbus_process_offer(struct work_struct *work)
INIT_WORK(&newchannel->work, vmbus_process_rescind_offer);

/* Make sure this is a new offer */
spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);

list_for_each_entry(channel, &gVmbusConnection.ChannelList, listentry) {
list_for_each_entry(channel, &vmbus_connection.ChannelList, listentry) {
if (!memcmp(&channel->offermsg.offer.InterfaceType,
&newchannel->offermsg.offer.InterfaceType,
sizeof(struct hv_guid)) &&
Expand All @@ -377,9 +377,9 @@ static void vmbus_process_offer(struct work_struct *work)

if (fnew)
list_add_tail(&newchannel->listentry,
&gVmbusConnection.ChannelList);
&vmbus_connection.ChannelList);

spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);

if (!fnew) {
DPRINT_DBG(VMBUS, "Ignoring duplicate offer for relid (%d)",
Expand Down Expand Up @@ -412,9 +412,9 @@ static void vmbus_process_offer(struct work_struct *work)
"unable to add child device object (relid %d)",
newchannel->offermsg.child_relid);

spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
list_del(&newchannel->listentry);
spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);

free_channel(newchannel);
} else {
Expand Down Expand Up @@ -577,9 +577,9 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr)
/*
* Find the open msg, copy the result and signal/unblock the wait event
*/
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &gVmbusConnection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.ChannelMsgList) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand All @@ -598,7 +598,7 @@ static void vmbus_onopen_result(struct vmbus_channel_message_header *hdr)
}
}
}
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
}

/*
Expand All @@ -625,9 +625,9 @@ static void vmbus_ongpadl_created(struct vmbus_channel_message_header *hdr)
* Find the establish msg, copy the result and signal/unblock the wait
* event
*/
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &gVmbusConnection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.ChannelMsgList) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand All @@ -648,7 +648,7 @@ static void vmbus_ongpadl_created(struct vmbus_channel_message_header *hdr)
}
}
}
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
}

/*
Expand All @@ -673,9 +673,9 @@ static void vmbus_ongpadl_torndown(
/*
* Find the open msg, copy the result and signal/unblock the wait event
*/
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &gVmbusConnection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.ChannelMsgList) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand All @@ -694,7 +694,7 @@ static void vmbus_ongpadl_torndown(
}
}
}
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
}

/*
Expand All @@ -715,9 +715,9 @@ static void vmbus_onversion_response(
unsigned long flags;

version_response = (struct vmbus_channel_version_response *)hdr;
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);

list_for_each(curr, &gVmbusConnection.ChannelMsgList) {
list_for_each(curr, &vmbus_connection.ChannelMsgList) {
/* FIXME: this should probably use list_entry() instead */
msginfo = (struct vmbus_channel_msginfo *)curr;
requestheader =
Expand All @@ -733,7 +733,7 @@ static void vmbus_onversion_response(
osd_waitevent_set(msginfo->waitevent);
}
}
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
}

/* Channel message dispatch table */
Expand Down Expand Up @@ -857,9 +857,9 @@ void vmbus_release_unattached_channels(void)
struct vmbus_channel *start = NULL;
unsigned long flags;

spin_lock_irqsave(&gVmbusConnection.channel_lock, flags);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);

list_for_each_entry_safe(channel, pos, &gVmbusConnection.ChannelList,
list_for_each_entry_safe(channel, pos, &vmbus_connection.ChannelList,
listentry) {
if (channel == start)
break;
Expand All @@ -878,7 +878,7 @@ void vmbus_release_unattached_channels(void)
}
}

spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags);
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
}

/* eof */
Loading

0 comments on commit 6398fe2

Please sign in to comment.