mutex.c 612 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/mutex.h>
  3. __rust_helper void rust_helper_mutex_lock(struct mutex *lock)
  4. {
  5. mutex_lock(lock);
  6. }
  7. __rust_helper int rust_helper_mutex_trylock(struct mutex *lock)
  8. {
  9. return mutex_trylock(lock);
  10. }
  11. __rust_helper void rust_helper___mutex_init(struct mutex *mutex,
  12. const char *name,
  13. struct lock_class_key *key)
  14. {
  15. __mutex_init(mutex, name, key);
  16. }
  17. __rust_helper void rust_helper_mutex_assert_is_held(struct mutex *mutex)
  18. {
  19. lockdep_assert_held(mutex);
  20. }
  21. __rust_helper void rust_helper_mutex_destroy(struct mutex *lock)
  22. {
  23. mutex_destroy(lock);
  24. }