rust/helpers/refcount.c
Source file repositories/reference/linux-study-clean/rust/helpers/refcount.c
File Facts
- System
- Linux kernel
- Corpus path
rust/helpers/refcount.c- Extension
.c- Size
- 529 bytes
- Lines
- 29
- Domain
- Rust Kernel Layer
- Bucket
- Rust API Membrane
- Inferred role
- Rust Kernel Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
- Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.
Dependency Surface
linux/refcount.h
Detected Declarations
function rust_helper_REFCOUNT_INITfunction rust_helper_refcount_setfunction rust_helper_refcount_incfunction rust_helper_refcount_decfunction rust_helper_refcount_dec_and_test
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/refcount.h>
__rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n)
{
return (refcount_t)REFCOUNT_INIT(n);
}
__rust_helper void rust_helper_refcount_set(refcount_t *r, int n)
{
refcount_set(r, n);
}
__rust_helper void rust_helper_refcount_inc(refcount_t *r)
{
refcount_inc(r);
}
__rust_helper void rust_helper_refcount_dec(refcount_t *r)
{
refcount_dec(r);
}
__rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r)
{
return refcount_dec_and_test(r);
}
Annotation
- Immediate include surface: `linux/refcount.h`.
- Detected declarations: `function rust_helper_REFCOUNT_INIT`, `function rust_helper_refcount_set`, `function rust_helper_refcount_inc`, `function rust_helper_refcount_dec`, `function rust_helper_refcount_dec_and_test`.
- Atlas domain: Rust Kernel Layer / Rust API Membrane.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.