Skip to content

Commit

Permalink
Staging: hv: osd: add osd_ prefix to global functions
Browse files Browse the repository at this point in the history
Put a "osd_" prefix on the osd.c functions in order for us to play nicer
in the kernel namespace.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Sep 15, 2009
1 parent fa56d36 commit bfc30aa
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 97 deletions.
26 changes: 13 additions & 13 deletions drivers/staging/hv/Channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ VmbusChannelOpen(
NewChannel->ChannelCallbackContext = Context;

/* Allocate the ring buffer */
out = PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT);
out = osd_PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT);
/* out = kzalloc(sendRingBufferSize + recvRingBufferSize, GFP_KERNEL); */
ASSERT(out);
ASSERT(((unsigned long)out & (PAGE_SIZE-1)) == 0);
Expand Down Expand Up @@ -268,7 +268,7 @@ VmbusChannelOpen(
openInfo = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_OPEN_CHANNEL), GFP_KERNEL);
ASSERT(openInfo != NULL);

openInfo->WaitEvent = WaitEventCreate();
openInfo->WaitEvent = osd_WaitEventCreate();

openMsg = (VMBUS_CHANNEL_OPEN_CHANNEL*)openInfo->Msg;
openMsg->Header.MessageType = ChannelMessageOpenChannel;
Expand Down Expand Up @@ -299,7 +299,7 @@ VmbusChannelOpen(
}

/* FIXME: Need to time-out here */
WaitEventWait(openInfo->WaitEvent);
osd_WaitEventWait(openInfo->WaitEvent);

if (openInfo->Response.OpenResult.Status == 0)
{
Expand Down Expand Up @@ -547,7 +547,7 @@ VmbusChannelEstablishGpadl(
ASSERT(msgInfo != NULL);
ASSERT(msgCount >0);

msgInfo->WaitEvent = WaitEventCreate();
msgInfo->WaitEvent = osd_WaitEventCreate();
gpadlMsg = (VMBUS_CHANNEL_GPADL_HEADER*)msgInfo->Msg;
gpadlMsg->Header.MessageType = ChannelMessageGpadlHeader;
gpadlMsg->ChildRelId = Channel->OfferMsg.ChildRelId;
Expand Down Expand Up @@ -587,7 +587,7 @@ VmbusChannelEstablishGpadl(
ASSERT(ret == 0);
}
}
WaitEventWait(msgInfo->WaitEvent);
osd_WaitEventWait(msgInfo->WaitEvent);

/* At this point, we received the gpadl created msg */
DPRINT_DBG(VMBUS, "Received GPADL created (relid %d, status %d handle %x)",
Expand Down Expand Up @@ -639,7 +639,7 @@ VmbusChannelTeardownGpadl(
info = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_TEARDOWN), GFP_KERNEL);
ASSERT(info != NULL);

info->WaitEvent = WaitEventCreate();
info->WaitEvent = osd_WaitEventCreate();

msg = (VMBUS_CHANNEL_GPADL_TEARDOWN*)info->Msg;

Expand All @@ -657,7 +657,7 @@ VmbusChannelTeardownGpadl(
/* TODO: */
}

WaitEventWait(info->WaitEvent);
osd_WaitEventWait(info->WaitEvent);

/* Received a torndown response */
spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
Expand Down Expand Up @@ -696,13 +696,13 @@ VmbusChannelClose(

/* Stop callback and cancel the timer asap */
Channel->OnChannelCallback = NULL;
TimerStop(Channel->PollTimer);
osd_TimerStop(Channel->PollTimer);

/* Send a closing message */
info = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_CLOSE_CHANNEL), GFP_KERNEL);
ASSERT(info != NULL);

/* info->waitEvent = WaitEventCreate(); */
/* info->waitEvent = osd_WaitEventCreate(); */

msg = (VMBUS_CHANNEL_CLOSE_CHANNEL*)info->Msg;
msg->Header.MessageType = ChannelMessageCloseChannel;
Expand All @@ -726,7 +726,7 @@ VmbusChannelClose(
RingBufferCleanup(&Channel->Outbound);
RingBufferCleanup(&Channel->Inbound);

PageFree(Channel->RingBufferPages, Channel->RingBufferPageCount);
osd_PageFree(Channel->RingBufferPages, Channel->RingBufferPageCount);

kfree(info);

Expand Down Expand Up @@ -1154,9 +1154,9 @@ VmbusChannelOnChannelEvent(
DumpVmbusChannel(Channel);
ASSERT(Channel->OnChannelCallback);
#ifdef ENABLE_POLLING
TimerStop(Channel->PollTimer);
osd_TimerStop(Channel->PollTimer);
Channel->OnChannelCallback(Channel->ChannelCallbackContext);
TimerStart(Channel->PollTimer, 100 /* 100us */);
osd_TimerStart(Channel->PollTimer, 100 /* 100us */);
#else
Channel->OnChannelCallback(Channel->ChannelCallbackContext);
#endif
Expand All @@ -1182,7 +1182,7 @@ VmbusChannelOnTimer(
{
channel->OnChannelCallback(channel->ChannelCallbackContext);
#ifdef ENABLE_POLLING
TimerStart(channel->PollTimer, 100 /* 100us */);
osd_TimerStart(channel->PollTimer, 100 /* 100us */);
#endif
}
}
Expand Down
18 changes: 9 additions & 9 deletions drivers/staging/hv/ChannelMgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static VMBUS_CHANNEL* AllocVmbusChannel(void)

spin_lock_init(&channel->inbound_lock);

channel->PollTimer = TimerCreate(VmbusChannelOnTimer, channel);
channel->PollTimer = osd_TimerCreate(VmbusChannelOnTimer, channel);
if (!channel->PollTimer)
{
kfree(channel);
Expand All @@ -152,7 +152,7 @@ static VMBUS_CHANNEL* AllocVmbusChannel(void)
channel->ControlWQ = create_workqueue("hv_vmbus_ctl");
if (!channel->ControlWQ)
{
TimerClose(channel->PollTimer);
osd_TimerClose(channel->PollTimer);
kfree(channel);
return NULL;
}
Expand Down Expand Up @@ -195,7 +195,7 @@ static inline void ReleaseVmbusChannel(void* Context)
--*/
static void FreeVmbusChannel(VMBUS_CHANNEL* Channel)
{
TimerClose(Channel->PollTimer);
osd_TimerClose(Channel->PollTimer);

/* We have to release the channel's workqueue/thread in the vmbus's workqueue/thread context */
/* ie we can't destroy ourselves. */
Expand Down Expand Up @@ -495,7 +495,7 @@ VmbusChannelOnOpenResult(
openMsg->OpenId == result->OpenId)
{
memcpy(&msgInfo->Response.OpenResult, result, sizeof(VMBUS_CHANNEL_OPEN_RESULT));
WaitEventSet(msgInfo->WaitEvent);
osd_WaitEventSet(msgInfo->WaitEvent);
break;
}
}
Expand Down Expand Up @@ -550,7 +550,7 @@ VmbusChannelOnGpadlCreated(
(gpadlCreated->Gpadl == gpadlHeader->Gpadl))
{
memcpy(&msgInfo->Response.GpadlCreated, gpadlCreated, sizeof(VMBUS_CHANNEL_GPADL_CREATED));
WaitEventSet(msgInfo->WaitEvent);
osd_WaitEventSet(msgInfo->WaitEvent);
break;
}
}
Expand Down Expand Up @@ -602,7 +602,7 @@ VmbusChannelOnGpadlTorndown(
if (gpadlTorndown->Gpadl == gpadlTeardown->Gpadl)
{
memcpy(&msgInfo->Response.GpadlTorndown, gpadlTorndown, sizeof(VMBUS_CHANNEL_GPADL_TORNDOWN));
WaitEventSet(msgInfo->WaitEvent);
osd_WaitEventSet(msgInfo->WaitEvent);
break;
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ VmbusChannelOnVersionResponse(
{
initiate = (VMBUS_CHANNEL_INITIATE_CONTACT*)requestHeader;
memcpy(&msgInfo->Response.VersionResponse, versionResponse, sizeof(VMBUS_CHANNEL_VERSION_RESPONSE));
WaitEventSet(msgInfo->WaitEvent);
osd_WaitEventSet(msgInfo->WaitEvent);
}
}
spin_unlock_irqrestore(&gVmbusConnection.channelmsg_lock, flags);
Expand Down Expand Up @@ -732,7 +732,7 @@ VmbusChannelRequestOffers(
msgInfo = kmalloc(sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_MESSAGE_HEADER), GFP_KERNEL);
ASSERT(msgInfo != NULL);

msgInfo->WaitEvent = WaitEventCreate();
msgInfo->WaitEvent = osd_WaitEventCreate();
msg = (VMBUS_CHANNEL_MESSAGE_HEADER*)msgInfo->Msg;

msg->MessageType = ChannelMessageRequestOffers;
Expand All @@ -752,7 +752,7 @@ VmbusChannelRequestOffers(

goto Cleanup;
}
/* WaitEventWait(msgInfo->waitEvent); */
/* osd_WaitEventWait(msgInfo->waitEvent); */

/*SpinlockAcquire(gVmbusConnection.channelMsgLock);
REMOVE_ENTRY_LIST(&msgInfo->msgListEntry);
Expand Down
14 changes: 7 additions & 7 deletions drivers/staging/hv/Connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ VmbusConnect(void)
* Setup the vmbus event connection for channel interrupt
* abstraction stuff
*/
gVmbusConnection.InterruptPage = PageAlloc(1);
gVmbusConnection.InterruptPage = osd_PageAlloc(1);
if (gVmbusConnection.InterruptPage == NULL)
{
ret = -1;
Expand All @@ -91,7 +91,7 @@ VmbusConnect(void)
* notification facility. The 1st page for parent->child and
* the 2nd page for child->parent
*/
gVmbusConnection.MonitorPages = PageAlloc(2);
gVmbusConnection.MonitorPages = osd_PageAlloc(2);
if (gVmbusConnection.MonitorPages == NULL)
{
ret = -1;
Expand All @@ -105,7 +105,7 @@ VmbusConnect(void)
goto Cleanup;
}

msgInfo->WaitEvent = WaitEventCreate();
msgInfo->WaitEvent = osd_WaitEventCreate();
msg = (VMBUS_CHANNEL_INITIATE_CONTACT*)msgInfo->Msg;

msg->Header.MessageType = ChannelMessageInitiateContact;
Expand Down Expand Up @@ -135,7 +135,7 @@ VmbusConnect(void)
}

/* Wait for the connection response */
WaitEventWait(msgInfo->WaitEvent);
osd_WaitEventWait(msgInfo->WaitEvent);

REMOVE_ENTRY_LIST(&msgInfo->MsgListEntry);

Expand Down Expand Up @@ -170,13 +170,13 @@ VmbusConnect(void)

if (gVmbusConnection.InterruptPage)
{
PageFree(gVmbusConnection.InterruptPage, 1);
osd_PageFree(gVmbusConnection.InterruptPage, 1);
gVmbusConnection.InterruptPage = NULL;
}

if (gVmbusConnection.MonitorPages)
{
PageFree(gVmbusConnection.MonitorPages, 2);
osd_PageFree(gVmbusConnection.MonitorPages, 2);
gVmbusConnection.MonitorPages = NULL;
}

Expand Down Expand Up @@ -228,7 +228,7 @@ VmbusDisconnect(
goto Cleanup;
}

PageFree(gVmbusConnection.InterruptPage, 1);
osd_PageFree(gVmbusConnection.InterruptPage, 1);

/* TODO: iterate thru the msg list and free up */

Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/hv/Hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ HvInit (
if (gHvContext.GuestId == HV_LINUX_GUEST_ID)
{
/* Allocate the hypercall page memory */
/* virtAddr = PageAlloc(1); */
virtAddr = VirtualAllocExec(PAGE_SIZE);
/* virtAddr = osd_PageAlloc(1); */
virtAddr = osd_VirtualAllocExec(PAGE_SIZE);

if (!virtAddr)
{
Expand Down Expand Up @@ -520,14 +520,14 @@ HvSynicInit (
}
else
{
gHvContext.synICMessagePage[0] = PageAlloc(1);
gHvContext.synICMessagePage[0] = osd_PageAlloc(1);
if (gHvContext.synICMessagePage[0] == NULL)
{
DPRINT_ERR(VMBUS, "unable to allocate SYNIC message page!!");
goto Cleanup;
}

gHvContext.synICEventPage[0] = PageAlloc(1);
gHvContext.synICEventPage[0] = osd_PageAlloc(1);
if (gHvContext.synICEventPage[0] == NULL)
{
DPRINT_ERR(VMBUS, "unable to allocate SYNIC event page!!");
Expand Down Expand Up @@ -587,12 +587,12 @@ HvSynicInit (
{
if (gHvContext.synICEventPage[0])
{
PageFree(gHvContext.synICEventPage[0],1);
osd_PageFree(gHvContext.synICEventPage[0],1);
}

if (gHvContext.synICMessagePage[0])
{
PageFree(gHvContext.synICMessagePage[0], 1);
osd_PageFree(gHvContext.synICMessagePage[0], 1);
}
}

Expand Down Expand Up @@ -654,8 +654,8 @@ HvSynicCleanup(

WriteMsr(HV_X64_MSR_SIEFP, siefp.AsUINT64);

PageFree(gHvContext.synICMessagePage[0], 1);
PageFree(gHvContext.synICEventPage[0], 1);
osd_PageFree(gHvContext.synICMessagePage[0], 1);
osd_PageFree(gHvContext.synICEventPage[0], 1);
}

DPRINT_EXIT(VMBUS);
Expand Down
Loading

0 comments on commit bfc30aa

Please sign in to comment.