aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rust/helpers/workqueue.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2024-09-27 15:36:52 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-09-27 15:36:52 -0300
commit52c996d3f40b40f87ef9dc80596903309682acc3 (patch)
treecccf9d5d20463b6930054e6f083f778f7ebe487a /rust/helpers/workqueue.c
parentperf symbol: Set binary_type of dso when loading (diff)
parentMerge tag 'mm-hotfixes-stable-2024-09-27-09-45' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm (diff)
downloadwireguard-linux-52c996d3f40b40f87ef9dc80596903309682acc3.tar.xz
wireguard-linux-52c996d3f40b40f87ef9dc80596903309682acc3.zip
Merge remote-tracking branch 'torvalds/master' into perf-tools
To pick up changes in other trees that may affect perf, such as libbpf and in general the header files that perf has copies of, so that we can do the sync with the kernel sources. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'rust/helpers/workqueue.c')
-rw-r--r--rust/helpers/workqueue.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
new file mode 100644
index 000000000000..f59427acc323
--- /dev/null
+++ b/rust/helpers/workqueue.c
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/workqueue.h>
+
+void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func,
+ bool onstack, const char *name,
+ struct lock_class_key *key)
+{
+ __init_work(work, onstack);
+ work->data = (atomic_long_t)WORK_DATA_INIT();
+ lockdep_init_map(&work->lockdep_map, name, key, 0);
+ INIT_LIST_HEAD(&work->entry);
+ work->func = func;
+}