public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Waiman Long <longman@redhat.com>
Subject: [PATCH] kthread: Export kthread_data()
Date: Fri,  9 Feb 2018 09:52:21 -0500	[thread overview]
Message-ID: <1518187941-29275-1-git-send-email-longman@redhat.com> (raw)

When multiple kernel threads are created to cooperatively work on
a common task, we may need a convenient way to access data that are
specific to each kthread.

The kthread_data() function fits this need.  However, it was not
visible to kthreads started in a kernel module. To solve this problem,
the kthread_data() function is now exported allowing kthreads from
kernel modules to use it.

Signed-off-by: Waiman Long <longman@redhat.com>
---
 kernel/kthread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index cd50e99..a71d461 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -156,6 +156,7 @@ void *kthread_data(struct task_struct *task)
 {
 	return to_kthread(task)->data;
 }
+EXPORT_SYMBOL(kthread_data);
 
 /**
  * kthread_probe_data - speculative version of kthread_data()
-- 
1.8.3.1

             reply	other threads:[~2018-02-09 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 14:52 Waiman Long [this message]
2018-02-12  9:24 ` [PATCH] kthread: Export kthread_data() Peter Zijlstra
2018-02-13 15:50 ` Christoph Hellwig
2018-02-13 21:40   ` Waiman Long
2018-02-13 21:42     ` Waiman Long

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=1518187941-29275-1-git-send-email-longman@redhat.com \
    --to=longman@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.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