From: xpankajbx@gmail.com (Pankaj B)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to set work_struct data
Date: Thu, 21 Apr 2011 17:17:41 +0530 [thread overview]
Message-ID: <BANLkTi=a0cu7Y-EjVhf6P6OxWnsM5Sirbg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimUvHRT8gOxDzDUrG03=wu3p7ouhA@mail.gmail.com>
On Thu, Apr 21, 2011 at 4:56 PM, Haojian Zhuang <haojian.zhuang@gmail.com>wrote:
> On Thu, Apr 21, 2011 at 6:22 PM, Pankaj B <xpankajbx@gmail.com> 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
prev parent reply other threads:[~2011-04-21 11:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 10:22 How to set work_struct data Pankaj B
2011-04-21 11:26 ` Haojian Zhuang
2011-04-21 11:47 ` Pankaj B [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTi=a0cu7Y-EjVhf6P6OxWnsM5Sirbg@mail.gmail.com' \
--to=xpankajbx@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).