refcount.c 529 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/refcount.h>
  3. __rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n)
  4. {
  5. return (refcount_t)REFCOUNT_INIT(n);
  6. }
  7. __rust_helper void rust_helper_refcount_set(refcount_t *r, int n)
  8. {
  9. refcount_set(r, n);
  10. }
  11. __rust_helper void rust_helper_refcount_inc(refcount_t *r)
  12. {
  13. refcount_inc(r);
  14. }
  15. __rust_helper void rust_helper_refcount_dec(refcount_t *r)
  16. {
  17. refcount_dec(r);
  18. }
  19. __rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r)
  20. {
  21. return refcount_dec_and_test(r);
  22. }