About how to access a queue in a data-struct

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

 



Hi, 
I have the following code:
I wanted to access the queue in the struct eventDest
after adding it into a list. However, I just can't do
it using this line of piece, how would I do it
actually:
tmp_2 = list_entry(tmp, struct eventDest, queue);

**************************************
LIST_HEAD(event_list);

struct eventDest{
  //Single lock for the whole data-structure
  spinlock_t eventLock;
  int eventID;
  //declare a task list
  int nb_process;
  wait_queue_head_t queue;
};
 
struct eventDest *event;

event=(struct eventDest *)kmalloc(sizeof(*event));

 list_add( &event_list, event);

 list_for_each( tmp, &event_list){
    id = list_entry(tmp, struct eventDest, eventID);
    if( id == tmpID ){ 
      tmp_2 = list_entry(tmp, struct eventDest,
queue);
      sleep_on(tmp_2);
    }
    printk("%d\n", id);
  }


--
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