[pso] Block device, struct page
Cristian Gratie
cgratie at yahoo.com
Mon May 12 03:39:20 EEST 2008
Uitandu-ma prin exemplul raid1.c din LXR, cred ca metoda de eliberare a paginilor este safe_put_page (page), rog pe cineva avizat sa confirme / infirme aceasta concluzie pe care am tras-o :D.
Cristi Gratie
----- Original Message ----
From: Mihai Borobocea <mihaiborobocea at gmail.com>
To: Proiectarea Sistemelor de Operare <pso at cursuri.cs.pub.ro>
Sent: Sunday, May 11, 2008 5:56:48 PM
Subject: [pso] Block device, struct page
Salut,
In solutia de la lab. 8 (Block device drivere), in directorul
lin/relay-disk este urmatorul cod:
struct page *page;
[...]
page = alloc_page(GFP_NOIO);
bio_add_page(bio, page, KERNEL_SECTOR_SIZE, 0);
[...]
bio_put(bio);
Cand creem o structura 'bio', dupa ce facem 'alloc_page' cred ca tot
noi trebuie sa facem '__free_page'.
Adica codul de mai sus ar deveni:
[...]
__free_page(page);
bio_put(bio);
Daca e asa, atunci inseamna ca putem refolosi un 'struct page' dupa ce
se termina un transfer bio (creat de noi), pana cand noi il dezalocam.
E corect?
Numai bine,
Mihai Borobocea
_______________________________________________
pso mailing list
pso at cursuri.cs.pub.ro
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
More information about the pso
mailing list