aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/osd.c
diff options
context:
space:
mode:
authorBill Pemberton <wfp5p@virginia.edu>2009-07-27 16:47:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:01:51 -0700
commitdf8d9b1f6deb468dd6752f0cd1029157c15248fd (patch)
tree8677869752d723584a118d2e2c0a422882bad603 /drivers/staging/hv/osd.c
parentStaging: hv: remove NETVSC_DEVICE typedef (diff)
downloadlinux-dev-df8d9b1f6deb468dd6752f0cd1029157c15248fd.tar.xz
linux-dev-df8d9b1f6deb468dd6752f0cd1029157c15248fd.zip
Staging: hv: Remove WORKQUEUE typedef
WORKQUEUE was a wrapper around struct workqueue_struct so just use that instead. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/osd.c')
-rw-r--r--drivers/staging/hv/osd.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index e683735706d1..4cee746d01c4 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -61,10 +61,6 @@ typedef struct _WAITEVENT {
wait_queue_head_t event;
} WAITEVENT;
-typedef struct _WORKQUEUE {
- struct workqueue_struct *queue;
-} WORKQUEUE;
-
typedef struct _WORKITEM {
struct work_struct work;
PFN_WORKITEM_CALLBACK callback;
@@ -303,31 +299,25 @@ void WorkItemCallback(struct work_struct *work)
kfree(w);
}
-HANDLE WorkQueueCreate(char* name)
+struct workqueue_struct *WorkQueueCreate(char *name)
{
- WORKQUEUE *wq = kmalloc(sizeof(WORKQUEUE), GFP_KERNEL);
- if (!wq)
- {
+ struct workqueue_struct *wq;
+ wq = create_workqueue(name);
+ if (unlikely(!wq))
return NULL;
- }
- wq->queue = create_workqueue(name);
-
return wq;
}
-void WorkQueueClose(HANDLE hWorkQueue)
+void WorkQueueClose(struct workqueue_struct *hWorkQueue)
{
- WORKQUEUE *wq = (WORKQUEUE *)hWorkQueue;
-
- destroy_workqueue(wq->queue);
-
+ destroy_workqueue(hWorkQueue);
return;
}
-int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, void* context)
+int WorkQueueQueueWorkItem(struct workqueue_struct *hWorkQueue,
+ PFN_WORKITEM_CALLBACK workItem,
+ void* context)
{
- WORKQUEUE *wq = (WORKQUEUE *)hWorkQueue;
-
WORKITEM* w = kmalloc(sizeof(WORKITEM), GFP_ATOMIC);
if (!w)
{
@@ -337,7 +327,7 @@ int WorkQueueQueueWorkItem(HANDLE hWorkQueue, PFN_WORKITEM_CALLBACK workItem, vo
w->callback = workItem,
w->context = context;
INIT_WORK(&w->work, WorkItemCallback);
- return queue_work(wq->queue, &w->work);
+ return queue_work(hWorkQueue, &w->work);
}
void QueueWorkItem(PFN_WORKITEM_CALLBACK workItem, void* context)