From mboxrd@z Thu Jan 1 00:00:00 1970 From: xpankajbx@gmail.com (Pankaj B) Date: Thu, 21 Apr 2011 17:17:41 +0530 Subject: How to set work_struct data In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Thu, Apr 21, 2011 at 4:56 PM, Haojian Zhuang wrote: > On Thu, Apr 21, 2011 at 6:22 PM, Pankaj B wrote: > > Hi, > > Current INIT_WORK() macro takes just work_struct pointer and function > > pointer. > > In previous kernels there used to be a third parameter for data. > > Is there a proper way to set data in work_struct? > > > Embed the work_struct into your structure. Then use container_of() to get > the > structure in work function. So you can add anything into your structure. > Good solution! Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110421/17a6deb4/attachment.html