mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
rust: refcount: Add __rust_helper to helpers
This is needed to inline these helpers into Rust code. Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Link: https://patch.msgid.link/20260105-define-rust-helper-v2-17-51da5f454a67@google.com
This commit is contained in:
parent
5e03edaed3
commit
9ba1aaf25a
1 changed files with 5 additions and 5 deletions
|
|
@ -2,27 +2,27 @@
|
|||
|
||||
#include <linux/refcount.h>
|
||||
|
||||
refcount_t rust_helper_REFCOUNT_INIT(int n)
|
||||
__rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n)
|
||||
{
|
||||
return (refcount_t)REFCOUNT_INIT(n);
|
||||
}
|
||||
|
||||
void rust_helper_refcount_set(refcount_t *r, int n)
|
||||
__rust_helper void rust_helper_refcount_set(refcount_t *r, int n)
|
||||
{
|
||||
refcount_set(r, n);
|
||||
}
|
||||
|
||||
void rust_helper_refcount_inc(refcount_t *r)
|
||||
__rust_helper void rust_helper_refcount_inc(refcount_t *r)
|
||||
{
|
||||
refcount_inc(r);
|
||||
}
|
||||
|
||||
void rust_helper_refcount_dec(refcount_t *r)
|
||||
__rust_helper void rust_helper_refcount_dec(refcount_t *r)
|
||||
{
|
||||
refcount_dec(r);
|
||||
}
|
||||
|
||||
bool rust_helper_refcount_dec_and_test(refcount_t *r)
|
||||
__rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r)
|
||||
{
|
||||
return refcount_dec_and_test(r);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue