summaryrefslogtreecommitdiff
path: root/rust/helpers/spinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'rust/helpers/spinlock.c')
-rw-r--r--rust/helpers/spinlock.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c
index 92f7fc418425..42c4bf01a23e 100644
--- a/rust/helpers/spinlock.c
+++ b/rust/helpers/spinlock.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include <linux/export.h>
#include <linux/spinlock.h>
void rust_helper___spin_lock_init(spinlock_t *lock, const char *name,
@@ -26,3 +25,13 @@ void rust_helper_spin_unlock(spinlock_t *lock)
{
spin_unlock(lock);
}
+
+int rust_helper_spin_trylock(spinlock_t *lock)
+{
+ return spin_trylock(lock);
+}
+
+void rust_helper_spin_assert_is_held(spinlock_t *lock)
+{
+ lockdep_assert_held(lock);
+}