Re: Another different problem with list_head

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 31 August 2005 11:38, Fawad Lateef wrote:
> On 8/31/05, Vincenzo Mallozzi <vinjunior@xxxxxxxx> wrote:
> > 
> > struct mtpmc_pages{
> >    struct list_head list;
> >    unsigned long addr;
> >    char page[PAGE_SIZE];
> > };
> > 
> > struct mtpmc_mm_struct{
> >    .......
> >    struct list_head pages_list;
> > };
> > 
> > struct mtpmc_mm_struct  mtpmc_dump_memory_descriptor(struct mm_struct *mm)
> > {
> >    struct mtpmc_mm_struct md;
> >    struct list_head *temp_list;
> >    struct mtpmc_wrprotected_pages *wrpage;
> >    pte_t *pte;
> >    struct page *page;
> >    struct mtpmc_pages *temp_page;
> > 
> >    INIT_LIST_HEAD(&md.pages_list);
> >    for (each address "address" we need) do{
> >        temp_page = (struct mtpmc_pages*) vmalloc(sizeof(struct 
mtpmc_pages));
> >        INIT_LIST_HEAD(&temp_page->list);
> 
> the above INIT_LIST_HEAD is unnecessary as you are adding the
> temp_page->list to md_pages_list (I m assuming this is the global
> variable of list_head) 

it's md.pages_list and not md_pages_list. It's a field of "struct 
mtpmc_mm_struct md;" declared above. It's not a global variable.


> Can u tell the sequence of calling the above two functions ??? Are u
> implementing any locking for accessing the list and these functions
> are called from different places ??? and make sure that md.pages_list
> will be global to access from other_function ....

I call only other_function function. In this function 
mtpmc_dump_memory_descriptor is called (as in the code I've listed)
Thanks.
Vincenzo Mallozzi.

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux