38 #include <linux/virgo_queue.h>
41 static int __init virgo_queue_init()
44 virgo_request_queue=kmalloc(VIRGO_QUEUE_SZ, GFP_ATOMIC);
49 printk(KERN_INFO
"virgo_queue_init(): use_workqueue=1");
50 if(virgo_kernel_wq==NULL)
52 printk(KERN_INFO
"virgo_queue_init(): use_workqueue=1, virgo_kernel_wq=NULL, creating a kernel workqueue\n");
53 virgo_kernel_wq = create_workqueue(
"virgo_kernel_workqueue");
90 vwqreq->data=kstrdup(req->data,GFP_ATOMIC);
91 printk(KERN_INFO
"push_request(): use_workqueue=1, enqueueing req in the kernel workqueue which will invoke handler, req->data = %s, vwqreq->work=%p, vwqreq->data = %s\n",req->data, &(vwqreq->work), vwqreq->data);
92 INIT_WORK(&(vwqreq->work),virgo_workqueue_handler);
93 queue_work(virgo_kernel_wq,&(vwqreq->work));
97 virgo_request_queue[queue_end].data=kstrdup(req->data,GFP_ATOMIC);
98 virgo_request_queue[queue_end].next=req->next;
102 EXPORT_SYMBOL(push_request);
106 return &virgo_request_queue[queue_front];
109 EXPORT_SYMBOL(pop_request);
111 static void __exit virgo_queue_exit()
116 MODULE_LICENSE(
"GPL");
117 module_init(virgo_queue_init);
118 module_exit(virgo_queue_exit);