Skip to content

Commit 90369eb

Browse files
committed
renamed pin_data to pin_project
1 parent 0a5d57e commit 90369eb

File tree

18 files changed

+44
-44
lines changed

18 files changed

+44
-44
lines changed

drivers/android/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Manager {
1717
uid: Option<bindings::kuid_t>,
1818
}
1919

20-
#[pin_data]
20+
#[pin_project]
2121
pub(crate) struct Context {
2222
#[pin]
2323
manager: Mutex<Manager>,

drivers/android/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct NodeDeathInner {
5656
aborted: bool,
5757
}
5858

59-
#[pin_data]
59+
#[pin_project]
6060
pub(crate) struct NodeDeath {
6161
node: Arc<Node>,
6262
process: Arc<Process>,

drivers/android/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl ProcessNodeRefs {
241241
}
242242
}
243243

244-
#[pin_data]
244+
#[pin_project]
245245
pub(crate) struct Process {
246246
ctx: Arc<Context>,
247247

drivers/android/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl InnerThread {
230230
}
231231
}
232232

233-
#[pin_data]
233+
#[pin_project]
234234
pub(crate) struct Thread {
235235
pub(crate) id: i32,
236236
pub(crate) process: Arc<Process>,

drivers/android/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct TransactionInner {
2727
file_list: List<Box<FileInfo>>,
2828
}
2929

30-
#[pin_data]
30+
#[pin_project]
3131
pub(crate) struct Transaction {
3232
#[pin]
3333
inner: SpinLock<TransactionInner>,

rust/kernel/device.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{clk::Clk, error::from_kernel_err_ptr};
99

1010
use crate::{
1111
bindings,
12-
macros::pin_data,
12+
macros::pin_project,
1313
pin_init,
1414
prelude::*,
1515
revocable::{Revocable, RevocableGuard},
@@ -233,7 +233,7 @@ impl Drop for Device {
233233
///
234234
/// This struct implements the `DeviceRemoval` trait so that it can clean resources up even if not
235235
/// explicitly called by the device drivers.
236-
#[pin_data]
236+
#[pin_project]
237237
pub struct Data<T, U, V> {
238238
#[pin]
239239
registrations: RevocableMutex<T>,

rust/kernel/init.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
//! ```rust
2626
//! # use kernel::prelude::*;
2727
//! # use core::pin::Pin;
28-
//! #[pin_data]
28+
//! #[pin_project]
2929
//! struct Foo {
3030
//! a: usize,
3131
//! b: u32,
@@ -44,7 +44,7 @@
4444
//! ```rust
4545
//! # use kernel::prelude::*;
4646
//! # use core::pin::Pin;
47-
//! # #[pin_data]
47+
//! # #[pin_project]
4848
//! # struct Foo {
4949
//! # a: usize,
5050
//! # b: u32,
@@ -69,7 +69,7 @@
6969
//! To declare an init macro/function you just return an `impl`[`PinInit<T, E>`]:
7070
//! ```rust
7171
//! # use kernel::prelude::*;
72-
//! #[pin_data]
72+
//! #[pin_project]
7373
//! struct DriverData {
7474
//! status: Mutex<i32>,
7575
//! buffer: Box<[u8; 1_000_000]>,
@@ -115,15 +115,15 @@ pub mod __private;
115115
///
116116
/// ```rust
117117
/// # #![allow(clippy::blacklisted_name, clippy::new_ret_no_self)]
118-
/// # use kernel::{init, pin_init, stack_init, init::*, macros::pin_data};
118+
/// # use kernel::{init, pin_init, stack_init, init::*, macros::pin_project};
119119
/// # use core::pin::Pin;
120-
/// #[pin_data]
120+
/// #[pin_project]
121121
/// struct Foo {
122122
/// a: usize,
123123
/// b: Bar,
124124
/// }
125125
///
126-
/// #[pin_data]
126+
/// #[pin_project]
127127
/// struct Bar {
128128
/// x: u32,
129129
/// }
@@ -153,15 +153,15 @@ macro_rules! stack_init {
153153
///
154154
/// ```rust
155155
/// # #![allow(clippy::blacklisted_name, clippy::new_ret_no_self)]
156-
/// # use kernel::{init, pin_init, macros::pin_data, init::*};
156+
/// # use kernel::{init, pin_init, macros::pin_project, init::*};
157157
/// # use core::pin::Pin;
158-
/// #[pin_data]
158+
/// #[pin_project]
159159
/// struct Foo {
160160
/// a: usize,
161161
/// b: Bar,
162162
/// }
163163
///
164-
/// #[pin_data]
164+
/// #[pin_project]
165165
/// struct Bar {
166166
/// x: u32,
167167
/// }
@@ -217,14 +217,14 @@ macro_rules! stack_init {
217217
///
218218
/// ```rust
219219
/// # #![allow(clippy::blacklisted_name, clippy::new_ret_no_self)]
220-
/// # use kernel::{init, pin_init, macros::pin_data, init::*};
220+
/// # use kernel::{init, pin_init, macros::pin_project, init::*};
221221
/// # use core::pin::Pin;
222-
/// # #[pin_data]
222+
/// # #[pin_project]
223223
/// # struct Foo {
224224
/// # a: usize,
225225
/// # b: Bar,
226226
/// # }
227-
/// # #[pin_data]
227+
/// # #[pin_project]
228228
/// # struct Bar {
229229
/// # x: u32,
230230
/// # }
@@ -245,14 +245,14 @@ macro_rules! stack_init {
245245
///
246246
/// ```rust
247247
/// # #![allow(clippy::blacklisted_name, clippy::new_ret_no_self)]
248-
/// # use kernel::{init, pin_init, macros::pin_data, init::*};
248+
/// # use kernel::{init, pin_init, macros::pin_project, init::*};
249249
/// # use core::pin::Pin;
250-
/// # #[pin_data]
250+
/// # #[pin_project]
251251
/// # struct Foo {
252252
/// # a: usize,
253253
/// # b: Bar,
254254
/// # }
255-
/// # #[pin_data]
255+
/// # #[pin_project]
256256
/// # struct Bar {
257257
/// # x: u32,
258258
/// # }
@@ -266,7 +266,7 @@ macro_rules! stack_init {
266266
/// # })
267267
/// # }
268268
/// # }
269-
/// #[pin_data]
269+
/// #[pin_project]
270270
/// struct FooContainer {
271271
/// #[pin]
272272
/// foo1: Foo,

rust/kernel/kasync/executor/workqueue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use super::{ArcWake, AutoStopHandle};
66
use crate::{
77
error::code::*,
8-
macros::pin_data,
8+
macros::pin_project,
99
new_mutex, pin_init,
1010
prelude::*,
1111
revocable::AsyncRevocable,
@@ -193,7 +193,7 @@ struct ExecutorInner {
193193
///
194194
/// # example_shared_workqueue().unwrap();
195195
/// ```
196-
#[pin_data]
196+
#[pin_project]
197197
pub struct Executor {
198198
queue: Either<BoxedQueue, &'static Queue>,
199199
#[pin]

rust/kernel/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use super::build_assert;
2121

2222
pub use super::{
2323
dbg, dev_alert, dev_crit, dev_dbg, dev_emerg, dev_err, dev_info, dev_notice, dev_warn, fmt,
24-
init, macros::pin_data, pin_init, pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info,
24+
init, macros::pin_project, pin_init, pr_alert, pr_crit, pr_debug, pr_emerg, pr_err, pr_info,
2525
pr_notice, pr_warn,
2626
};
2727

rust/kernel/sync/condvar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use super::{Guard, Lock, LockClassKey, LockInfo};
99
use crate::{
1010
bindings,
1111
init::{PinInit, PinInitClosure},
12-
macros::pin_data,
12+
macros::pin_project,
1313
pin_init,
1414
str::CStr,
1515
task::Task,
@@ -38,7 +38,7 @@ const POLLFREE: u32 = 0x4000;
3838
///
3939
/// [`struct wait_queue_head`]: ../../../include/linux/wait.h
4040
/// [init]: ../init/index.html
41-
#[pin_data]
41+
#[pin_project]
4242
pub struct CondVar {
4343
#[pin]
4444
pub(crate) wait_list: Opaque<bindings::wait_queue_head>,

rust/kernel/sync/mutex.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::{Guard, Lock, LockClassKey, LockFactory, WriteLock};
88
use crate::{
99
bindings,
1010
init::{PinInit, PinInitClosure},
11-
macros::pin_data,
11+
macros::pin_project,
1212
pin_init,
1313
str::CStr,
1414
Opaque,
@@ -34,7 +34,7 @@ macro_rules! new_mutex {
3434
///
3535
/// [`struct mutex`]: ../../../include/linux/mutex.h
3636
/// [init]: ../init/index.html
37-
#[pin_data]
37+
#[pin_project]
3838
pub struct Mutex<T: ?Sized> {
3939
/// The kernel `struct mutex` object.
4040
#[pin]

rust/kernel/sync/revocable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use crate::{
66
init::PinInit,
7-
macros::pin_data,
7+
macros::pin_project,
88
pin_init,
99
str::CStr,
1010
sync::{Guard, Lock, LockClassKey, LockFactory, LockInfo, ReadLock, WriteLock},
@@ -101,7 +101,7 @@ impl<T> Drop for Inner<T> {
101101
/// assert_eq!(add_two(&v), None);
102102
/// ```
103103
/// [init]: ../init/index.html
104-
#[pin_data]
104+
#[pin_project]
105105
pub struct Revocable<F, T>
106106
where
107107
F: LockFactory,

rust/kernel/sync/rwsem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use super::{
1212
use crate::{
1313
bindings,
1414
init::{PinInit, PinInitClosure},
15-
macros::pin_data,
15+
macros::pin_project,
1616
pin_init,
1717
str::CStr,
1818
Opaque,
@@ -39,7 +39,7 @@ macro_rules! new_rwsemaphore {
3939
///
4040
/// [`struct rw_semaphore`]: ../../../include/linux/rwsem.h
4141
/// [init]: ../init/index.html
42-
#[pin_data]
42+
#[pin_project]
4343
pub struct RwSemaphore<T: ?Sized> {
4444
/// The kernel `struct rw_semaphore` object.
4545
#[pin]

rust/kernel/sync/seqlock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use super::{Guard, Lock, LockClassKey, LockFactory, ReadLock};
1111
use crate::{
1212
bindings,
1313
init::{PinInit, PinInitClosure},
14-
macros::pin_data,
14+
macros::pin_project,
1515
pin_init,
1616
str::CStr,
1717
Opaque,
@@ -61,7 +61,7 @@ use core::{cell::UnsafeCell, marker::PhantomPinned, ops::Deref};
6161
/// guard.b.store(b + 1, Ordering::Relaxed);
6262
/// }
6363
/// ```
64-
#[pin_data]
64+
#[pin_project]
6565
pub struct SeqLock<L: ?Sized>
6666
where
6767
L: Lock,

rust/kernel/sync/spinlock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use super::{
1212
use crate::{
1313
bindings,
1414
init::{PinInit, PinInitClosure},
15-
macros::pin_data,
15+
macros::pin_project,
1616
pin_init,
1717
str::CStr,
1818
Opaque, True,
@@ -82,7 +82,7 @@ macro_rules! new_spinlock {
8282
///
8383
/// [`spinlock_t`]: ../../../include/linux/spinlock.h
8484
/// [init]: ../init/index.html
85-
#[pin_data]
85+
#[pin_project]
8686
pub struct SpinLock<T: ?Sized> {
8787
#[pin]
8888
spin_lock: Opaque<bindings::spinlock>,
@@ -273,7 +273,7 @@ macro_rules! new_rawspinlock {
273273
/// ```
274274
///
275275
/// [`raw_spinlock_t`]: ../../../include/linux/spinlock.h
276-
#[pin_data]
276+
#[pin_project]
277277
pub struct RawSpinLock<T: ?Sized> {
278278
#[pin]
279279
spin_lock: Opaque<bindings::raw_spinlock>,

rust/macros/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub fn concat_idents(ts: TokenStream) -> TokenStream {
201201
/// # Examples
202202
///
203203
/// ```rust,ignore
204-
/// #[pin_data]
204+
/// #[pin_project]
205205
/// struct A {
206206
/// #[pin]
207207
/// a: usize,

samples/rust/rust_miscdev.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use kernel::prelude::*;
66
use kernel::{
77
file::{self, File},
88
io_buffer::{IoBufferReader, IoBufferWriter},
9-
macros::pin_data,
9+
macros::pin_project,
1010
miscdev, new_condvar, new_mutex, pin_init,
1111
sync::{Arc, ArcBorrow, CondVar, Mutex, UniqueArc},
1212
};
@@ -25,7 +25,7 @@ struct SharedStateInner {
2525
token_count: usize,
2626
}
2727

28-
#[pin_data]
28+
#[pin_project]
2929
struct SharedState {
3030
#[pin]
3131
state_changed: CondVar,

samples/rust/rust_semaphore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use core::sync::atomic::{AtomicU64, Ordering};
1717
use kernel::{
1818
file::{self, File, IoctlCommand, IoctlHandler},
1919
io_buffer::{IoBufferReader, IoBufferWriter},
20-
macros::pin_data,
20+
macros::pin_project,
2121
miscdev::Registration,
2222
new_condvar, new_mutex, pin_init,
2323
prelude::*,
@@ -38,7 +38,7 @@ struct SemaphoreInner {
3838
max_seen: usize,
3939
}
4040

41-
#[pin_data]
41+
#[pin_project]
4242
struct Semaphore {
4343
#[pin]
4444
changed: CondVar,

0 commit comments

Comments
 (0)