2024-08-15 10:30:26 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
|
|
#include <linux/mutex.h>
|
|
|
|
|
|
2026-01-05 12:42:33 +00:00
|
|
|
__rust_helper void rust_helper_mutex_lock(struct mutex *lock)
|
2024-08-15 10:30:26 +00:00
|
|
|
{
|
|
|
|
|
mutex_lock(lock);
|
|
|
|
|
}
|
2024-09-16 09:37:52 +02:00
|
|
|
|
2026-01-05 12:42:33 +00:00
|
|
|
__rust_helper int rust_helper_mutex_trylock(struct mutex *lock)
|
2025-05-28 10:34:30 +02:00
|
|
|
{
|
|
|
|
|
return mutex_trylock(lock);
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-05 12:42:33 +00:00
|
|
|
__rust_helper void rust_helper___mutex_init(struct mutex *mutex,
|
|
|
|
|
const char *name,
|
|
|
|
|
struct lock_class_key *key)
|
2024-09-16 09:37:52 +02:00
|
|
|
{
|
|
|
|
|
__mutex_init(mutex, name, key);
|
|
|
|
|
}
|
2024-11-25 15:40:58 -05:00
|
|
|
|
2026-01-05 12:42:33 +00:00
|
|
|
__rust_helper void rust_helper_mutex_assert_is_held(struct mutex *mutex)
|
2024-11-25 15:40:58 -05:00
|
|
|
{
|
|
|
|
|
lockdep_assert_held(mutex);
|
|
|
|
|
}
|
2025-05-08 10:52:09 +02:00
|
|
|
|
2026-01-05 12:42:33 +00:00
|
|
|
__rust_helper void rust_helper_mutex_destroy(struct mutex *lock)
|
2025-05-08 10:52:09 +02:00
|
|
|
{
|
|
|
|
|
mutex_destroy(lock);
|
|
|
|
|
}
|