Skip to content

Commit 84c5935

Browse files
author
Maxim Levitsky
committed
rust: add helper for mutex_trylock
JIRA: https://issues.redhat.com/browse/RHEL-74410 commit 4dbe28c Author: Paolo Bonzini <pbonzini@redhat.com> Date: Wed May 28 10:34:30 2025 +0200 rust: add helper for mutex_trylock After commit c5b6aba ("locking/mutex: implement mutex_trylock_nested", currently in the KVM tree) mutex_trylock() will be a macro when lockdep is enabled. Rust therefore needs the corresponding helper. Just add it and the rust/bindings/bindings_helpers_generated.rs Makefile rules will do their thing. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250528083431.1875345-1-pbonzini@redhat.com> Acked-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
1 parent 469e917 commit 84c5935

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/helpers/mutex.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ void rust_helper_mutex_lock(struct mutex *lock)
88
mutex_lock(lock);
99
}
1010

11+
int rust_helper_mutex_trylock(struct mutex *lock)
12+
{
13+
return mutex_trylock(lock);
14+
}
15+
1116
void rust_helper___mutex_init(struct mutex *mutex, const char *name,
1217
struct lock_class_key *key)
1318
{

0 commit comments

Comments
 (0)