mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-15 22:31:47 -04:00
rust: task: update ARef and AlwaysRefCounted imports from sync::aref
Update call sites in `task.rs` to import `ARef` and `AlwaysRefCounted` from `sync::aref` instead of `types`. This aligns with the ongoing effort to move `ARef` and `AlwaysRefCounted` to sync. Suggested-by: Benno Lossin <lossin@kernel.org> Link: https://github.com/Rust-for-Linux/linux/issues/1173 Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
committed by
Miguel Ojeda
parent
72b04a8af7
commit
4710b47988
@@ -9,7 +9,8 @@
|
||||
ffi::{c_int, c_long, c_uint},
|
||||
mm::MmWithUser,
|
||||
pid_namespace::PidNamespace,
|
||||
types::{ARef, NotThreadSafe, Opaque},
|
||||
sync::aref::ARef,
|
||||
types::{NotThreadSafe, Opaque},
|
||||
};
|
||||
use core::{
|
||||
cmp::{Eq, PartialEq},
|
||||
@@ -76,7 +77,7 @@ macro_rules! current {
|
||||
/// incremented when creating `State` and decremented when it is dropped:
|
||||
///
|
||||
/// ```
|
||||
/// use kernel::{task::Task, types::ARef};
|
||||
/// use kernel::{task::Task, sync::aref::ARef};
|
||||
///
|
||||
/// struct State {
|
||||
/// creator: ARef<Task>,
|
||||
@@ -347,7 +348,7 @@ pub fn active_pid_ns(&self) -> Option<&PidNamespace> {
|
||||
}
|
||||
|
||||
// SAFETY: The type invariants guarantee that `Task` is always refcounted.
|
||||
unsafe impl crate::types::AlwaysRefCounted for Task {
|
||||
unsafe impl crate::sync::aref::AlwaysRefCounted for Task {
|
||||
#[inline]
|
||||
fn inc_ref(&self) {
|
||||
// SAFETY: The existence of a shared reference means that the refcount is nonzero.
|
||||
|
||||
Reference in New Issue
Block a user