[pso] work_struct::data

Alexandru Mosoi brtzsnr at gmail.com
Thu May 15 01:11:46 EEST 2008


grhhh. de unde invechit? l-am luat din LDD3. asa... plus ca mi se pare ceva
gresit in laborator. work_struct este defapt o lista inlantuita si mereu (in
laborator) se pune in coada exact acelasi element (acelasi pointer). eu am
alocat workqueue-ul si l-am eliberat in handler (m-am uitat in doc... err...
surse si e corect ce fac). problema mea e cum folosesc data ala? ca mi-am
pierdut deja 2 ore de somn incercand sa-mi dau seama treaba cu el
(atribuirea lui dupa INIT/PREPARE_WORK face ca handlerul sa nu fie chemat).

2008/5/15 Razvan Deaconescu <razvand at cs.pub.ro>:

> On Wed, 2008-05-14 at 23:51 +0300, Alexandru Mosoi wrote:
> > incerc sa folosesc membrul data pentru a transmite pointerul la
> > structura bio astfel:
> >
> > work_handler:
> >
> >     struct bio* bio =
> >         (struct bio *)atomic_long_read(&work->data);
> >
> >     printk(KERN_ALERT "handler bio = %p\n", bio);
> >
> >
> > bio_request
> >
> >     printk(KERN_ALERT "request bio = %p\n", bio);
> >
> >     atomic_long_set(&device->work.data, (long)bio);
> >     PREPARE_WORK(&device->work, ssr_work_handler);
> >     schedule_work(&device->work);
> >
> >
> > nu stiu ce gresesc, dar cei doi pointeri sunt distincti.
>
> Hmmm ... de unde ai luat exemplele de folosire a work-queue-urilor?
> API-ul folosit de tine este invechit. Te-ai uitat pe solutiile
> laboratorului 7 [1] (exercitiul 4) pentru un model de folosire a
> work-struct-urilor? Sau chiar in laborator[2]?
>
> Razvan
>
> [1] http://cs.pub.ro/~pso/wiki/images/4/41/Lab7-tasks-sol.zip<http://cs.pub.ro/%7Epso/wiki/images/4/41/Lab7-tasks-sol.zip>
> [2]
> http://cs.pub.ro/~pso/index.php?section=Laboratoare&file=07.%20Actiuni%20amanabile#Workqueues<http://cs.pub.ro/%7Epso/index.php?section=Laboratoare&file=07.%20Actiuni%20amanabile#Workqueues>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> _______________________________________________
> pso mailing list
> pso at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
>



-- 
Alexandru Moşoi
http://alexandru.mosoi.googlepages.com

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20080515/5b4f2a38/attachment.htm 


More information about the pso mailing list