kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: haojian.zhuang@gmail.com (Haojian Zhuang)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to set work_struct data
Date: Thu, 21 Apr 2011 19:26:27 +0800	[thread overview]
Message-ID: <BANLkTimUvHRT8gOxDzDUrG03=wu3p7ouhA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinwZTJbOsUkOwKnU71Q8+zPQPSXFg@mail.gmail.com>

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.

> Thanks
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>

  reply	other threads:[~2011-04-21 11:26 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 [this message]
2011-04-21 11:47   ` Pankaj B

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='BANLkTimUvHRT8gOxDzDUrG03=wu3p7ouhA@mail.gmail.com' \
    --to=haojian.zhuang@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).