linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
@ 2025-07-16  9:07 ` Shankari Anand
  2025-07-16 12:38   ` Miguel Ojeda
  2025-08-08  9:53   ` Andreas Hindborg
  0 siblings, 2 replies; 7+ messages in thread
From: Shankari Anand @ 2025-07-16  9:07 UTC (permalink / raw)
  To: Andreas Hindborg, Jens Axboe, Miguel Ojeda, Alex Gaynor,
	linux-block, rust-for-linux, linux-kernel
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Shankari Anand

Update call sites in the block subsystem 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>
---
It part of a subsystem-wise split series, as suggested in:
https://lore.kernel.org/rust-for-linux/CANiq72=NSRMV_6UxXVgkebmWmbgN4i=sfRszr-G+x3W5A4DYOg@mail.gmail.com/T/#u
This split series is intended to ease review and subsystem-level maintenance.

The original moving patch is here:
https://lore.kernel.org/rust-for-linux/20250625111133.698481-1-shankari.ak0208@gmail.com/

Gradually the re-export from types.rs will be eliminated in the
future cycle.
---
 drivers/block/rnull.rs             | 3 +--
 rust/kernel/block/mq.rs            | 8 ++++----
 rust/kernel/block/mq/operations.rs | 2 +-
 rust/kernel/block/mq/request.rs    | 3 ++-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/block/rnull.rs b/drivers/block/rnull.rs
index d07e76ae2c13..80a0f7aa949e 100644
--- a/drivers/block/rnull.rs
+++ b/drivers/block/rnull.rs
@@ -20,8 +20,7 @@
     error::Result,
     new_mutex, pr_info,
     prelude::*,
-    sync::{Arc, Mutex},
-    types::ARef,
+    sync::{aref::ARef, Arc, Mutex},
 };
 
 module! {
diff --git a/rust/kernel/block/mq.rs b/rust/kernel/block/mq.rs
index 831445d37181..3e7e0de92604 100644
--- a/rust/kernel/block/mq.rs
+++ b/rust/kernel/block/mq.rs
@@ -20,7 +20,7 @@
 //! The kernel will interface with the block device driver by calling the method
 //! implementations of the `Operations` trait.
 //!
-//! IO requests are passed to the driver as [`kernel::types::ARef<Request>`]
+//! IO requests are passed to the driver as [`kernel::sync::aref::ARef<Request>`]
 //! instances. The `Request` type is a wrapper around the C `struct request`.
 //! The driver must mark end of processing by calling one of the
 //! `Request::end`, methods. Failure to do so can lead to deadlock or timeout
@@ -57,12 +57,12 @@
 //!
 //! ```rust
 //! use kernel::{
 //!     alloc::flags,
 //!     block::mq::*,
 //!     new_mutex,
 //!     prelude::*,
-//!     sync::{Arc, Mutex},
-//!     types::{ARef, ForeignOwnable},
+//!     sync::{aref::ARef, Arc, Mutex},
+//!     types::ForeignOwnable,
 //! };
 //!
 //! struct MyBlkDevice;
diff --git a/rust/kernel/block/mq/operations.rs b/rust/kernel/block/mq/operations.rs
index c2b98f507bcb..18d858763e08 100644
--- a/rust/kernel/block/mq/operations.rs
+++ b/rust/kernel/block/mq/operations.rs
@@ -10,7 +10,7 @@
     block::mq::Request,
     error::{from_result, Result},
     prelude::*,
-    types::ARef,
+    sync::aref::ARef,
 };
 use core::{marker::PhantomData, sync::atomic::AtomicU64, sync::atomic::Ordering};
 
diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs
index fefd394f064a..9cca7852b309 100644
--- a/rust/kernel/block/mq/request.rs
+++ b/rust/kernel/block/mq/request.rs
@@ -8,7 +8,8 @@
     bindings,
     block::mq::Operations,
     error::Result,
-    types::{ARef, AlwaysRefCounted, Opaque},
+    sync::aref::{ARef, AlwaysRefCounted},
+    types::Opaque,
 };
 use core::{
     marker::PhantomData,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
  2025-07-16  9:07 ` [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref Shankari Anand
@ 2025-07-16 12:38   ` Miguel Ojeda
  2025-08-08  9:53   ` Andreas Hindborg
  1 sibling, 0 replies; 7+ messages in thread
From: Miguel Ojeda @ 2025-07-16 12:38 UTC (permalink / raw)
  To: Shankari Anand
  Cc: Andreas Hindborg, Jens Axboe, Miguel Ojeda, Alex Gaynor,
	linux-block, rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Alice Ryhl, Trevor Gross,
	Danilo Krummrich

On Wed, Jul 16, 2025 at 11:07 AM Shankari Anand
<shankari.ak0208@gmail.com> wrote:
>
> It part of a subsystem-wise split series, as suggested in:
> https://lore.kernel.org/rust-for-linux/CANiq72=NSRMV_6UxXVgkebmWmbgN4i=sfRszr-G+x3W5A4DYOg@mail.gmail.com/T/#u
> This split series is intended to ease review and subsystem-level maintenance.
>
> The original moving patch is here:
> https://lore.kernel.org/rust-for-linux/20250625111133.698481-1-shankari.ak0208@gmail.com/
>
> Gradually the re-export from types.rs will be eliminated in the
> future cycle.

Thanks for splitting it Shankari, that should help get this landed.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
  2025-07-16  9:07 ` [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref Shankari Anand
  2025-07-16 12:38   ` Miguel Ojeda
@ 2025-08-08  9:53   ` Andreas Hindborg
  2025-08-10 11:42     ` Miguel Ojeda
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Hindborg @ 2025-08-08  9:53 UTC (permalink / raw)
  To: Shankari Anand, Jens Axboe, Miguel Ojeda, Alex Gaynor,
	linux-block, rust-for-linux, linux-kernel
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Shankari Anand

"Shankari Anand" <shankari.ak0208@gmail.com> writes:

> Update call sites in the block subsystem 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>

Acked-by: Andreas Hindborg <a.hindborg@kernel.org>


Best regards,
Andreas Hindborg




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
  2025-08-08  9:53   ` Andreas Hindborg
@ 2025-08-10 11:42     ` Miguel Ojeda
  2025-08-11  7:49       ` Andreas Hindborg
  0 siblings, 1 reply; 7+ messages in thread
From: Miguel Ojeda @ 2025-08-10 11:42 UTC (permalink / raw)
  To: Andreas Hindborg
  Cc: Shankari Anand, Jens Axboe, Miguel Ojeda, Alex Gaynor,
	linux-block, rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Alice Ryhl, Trevor Gross,
	Danilo Krummrich

On Fri, Aug 8, 2025 at 11:53 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
> Acked-by: Andreas Hindborg <a.hindborg@kernel.org>

I think you can pick this one, i.e. the idea was to allow changes to
be picked independently.

Otherwise, I can pick it eventually with the final change, but it
would be best to get these cleanups done.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
  2025-08-10 11:42     ` Miguel Ojeda
@ 2025-08-11  7:49       ` Andreas Hindborg
  2025-08-11 10:44         ` Miguel Ojeda
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Hindborg @ 2025-08-11  7:49 UTC (permalink / raw)
  To: Miguel Ojeda, Jens Axboe
  Cc: Shankari Anand, Miguel Ojeda, Alex Gaynor, linux-block,
	rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Alice Ryhl, Trevor Gross,
	Danilo Krummrich

"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com> writes:

> On Fri, Aug 8, 2025 at 11:53 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>>
>> Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
>
> I think you can pick this one, i.e. the idea was to allow changes to
> be picked independently.

Jens is picking the block patches directly from list. I would prefer
sending a PR, but that is not the way we agreed on doing it.

@Jens, do you still prefer to pick the rust block patches directly?

Best regards,
Andreas Hindborg




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
  2025-08-11  7:49       ` Andreas Hindborg
@ 2025-08-11 10:44         ` Miguel Ojeda
  2025-08-25  5:41           ` Shankari Anand
  0 siblings, 1 reply; 7+ messages in thread
From: Miguel Ojeda @ 2025-08-11 10:44 UTC (permalink / raw)
  To: Andreas Hindborg
  Cc: Jens Axboe, Shankari Anand, Miguel Ojeda, Alex Gaynor,
	linux-block, rust-for-linux, linux-kernel, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Alice Ryhl, Trevor Gross,
	Danilo Krummrich

On Mon, Aug 11, 2025 at 9:49 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>
> Jens is picking the block patches directly from list. I would prefer
> sending a PR, but that is not the way we agreed on doing it.
>
> @Jens, do you still prefer to pick the rust block patches directly?

That is fine, if Jens wants to pick it, that is nice. Otherwise, I can
pick it up, no worries.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref
  2025-08-11 10:44         ` Miguel Ojeda
@ 2025-08-25  5:41           ` Shankari Anand
  0 siblings, 0 replies; 7+ messages in thread
From: Shankari Anand @ 2025-08-25  5:41 UTC (permalink / raw)
  To: Miguel Ojeda, Andreas Hindborg, Jens Axboe
  Cc: Miguel Ojeda, Alex Gaynor, linux-block, rust-for-linux,
	linux-kernel, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Alice Ryhl, Trevor Gross, Danilo Krummrich

On Mon, Aug 11, 2025 at 12:44:01PM +0200, Miguel Ojeda wrote:
> On Mon, Aug 11, 2025 at 9:49 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
> >
> > Jens is picking the block patches directly from list. I would prefer
> > sending a PR, but that is not the way we agreed on doing it.
> >
> > @Jens, do you still prefer to pick the rust block patches directly?
> 
> That is fine, if Jens wants to pick it, that is nice. Otherwise, I can
> pick it up, no worries.
> 
> Thanks!
> 
> Cheers,
> Miguel

Hi Jens, Miguel,

Just a kind reminder about this patch I sent earlier.
Thanks a lot for your time!

Cheers,
Shankari

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-08-25  5:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <KnSfzGK6OiA0mL5BZ32IZgEYWCuETu6ggzSHiqnzsYBLsUHWR5GcVRzt-FSa8sCXmYXz_jOKWGZ6B_QyeTZS2w==@protonmail.internalid>
2025-07-16  9:07 ` [PATCH 1/7] rust: block: update ARef and AlwaysRefCounted imports from sync::aref Shankari Anand
2025-07-16 12:38   ` Miguel Ojeda
2025-08-08  9:53   ` Andreas Hindborg
2025-08-10 11:42     ` Miguel Ojeda
2025-08-11  7:49       ` Andreas Hindborg
2025-08-11 10:44         ` Miguel Ojeda
2025-08-25  5:41           ` Shankari Anand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).