From 57706d1824dce874188c12f736ffd5bdd3823173 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Fri, 26 Apr 2019 10:40:40 +0200 Subject: [PATCH] thread: add spdk_thread_get_cpumask() Change-Id: I2811bdbbecb28c83403ebe94834afd9a808f12a4 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452203 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- include/spdk/thread.h | 9 +++++++++ lib/thread/thread.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/include/spdk/thread.h b/include/spdk/thread.h index 64b04bec9..3b1d7f738 100644 --- a/include/spdk/thread.h +++ b/include/spdk/thread.h @@ -226,6 +226,15 @@ void spdk_thread_exit(struct spdk_thread *thread); */ void *spdk_thread_get_ctx(struct spdk_thread *thread); +/** + * Get the thread's cpumask. + * + * \param thread The thread to get the cpumask for. + * + * \return cpuset pointer + */ +struct spdk_cpuset *spdk_thread_get_cpumask(struct spdk_thread *thread); + /** * Return the thread object associated with the context handle previously * obtained by calling spdk_thread_get_ctx(). diff --git a/lib/thread/thread.c b/lib/thread/thread.c index 391169582..c66281bd0 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -339,6 +339,12 @@ spdk_thread_get_ctx(struct spdk_thread *thread) return NULL; } +struct spdk_cpuset * +spdk_thread_get_cpumask(struct spdk_thread *thread) +{ + return thread->cpumask; +} + struct spdk_thread * spdk_thread_get_from_ctx(void *ctx) {