From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 473EA1A9F8F for ; Sun, 12 Oct 2025 14:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760278826; cv=none; b=MVN4UqnkW6Wf06UlFOLp5DHpNkau6jomj+0sk6ydwIV9bxqEQgO7Sq15zKYsoe/BWvNo31SjM4iqouqT4If5tt++QkV9e0b6LlzYMbgvaf1e6FKN4rn1migpdH4wJ0nToXzC3vAEQADmgiiruAbk27qQsTH09moKX4M1woy23Zk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760278826; c=relaxed/simple; bh=2k6zfbV5v2cf+4wgu/XCSpdhWf+Wu46HVvzRy5EuNf8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=adr5QiHHYNokpWmN/Ec3wFvgcuCyzB2gtjadngWHb7W1T0/dnJ4LlWIl6OE3MKLkyKAU3n1FqZAJl8TNZLK8NELjA5atYeV3mD0O2lEMO9cHSK1+ZzgYTxtnWaZvG2ASRdKvlZPut1nNixp3nU+YRuunapIit9KgNrfzlL0dy6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Co8vOhR4; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Co8vOhR4" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-27c369f898fso47016315ad.3 for ; Sun, 12 Oct 2025 07:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760278824; x=1760883624; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hfkmdzafh7+VHjG0RAeg5sF4FBAljqq3jIvcOzngZlg=; b=Co8vOhR4jNm0dn3Aoz4mtvMDX+V3QoxoynHZgrs3wbB7HQ2mTAI/77rJPCTa3ldC2J o9HkYQfL7s7fD/xprG06pkSlybgXnnbF+aTXrt6is8hrCOcfgE76euD/tQ1+TDld5Qcf PmFIeiCp/EgefscWXP9AKCQKLDUcD3EFmwmiXwL1LlPLxKGVP7lWFpRyMFvD/0qcJA5q mu2Jrbd7cVWTRQQRC4ZU/ggQUPBf7AkyLmT0XqtyHgsyQGBWsXeNfPW14TmRmwhQR7p/ ii7Aib7KVOI7wG0dc7eYhwLShseVFT+/eiHLlriKcIrnONnokn84BNUe/e/3N5V6V7mF 4ouQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760278824; x=1760883624; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hfkmdzafh7+VHjG0RAeg5sF4FBAljqq3jIvcOzngZlg=; b=sNr4IUIbu8qzzeLr9udUOaFgJGRHZ3ZRdTDTl2wBeCdKvLjPBAAI5PzaXribzZoWhz kSSONHqNe5HcwZoOcteycpE2hCryAtGBkBa3RV6e16wxr5lYDahONCWH1dgB+Ni0B0oO RI9NohHMPvnFiqGj5kvEPiRNSveCWYm0IX5HL5KR7W73zXku2CHtBleOXOOe7bC0BC4M WrvBnOZ52JONTcBEg8DkMhOKVFAGY4K8UjgWDVkCzh7pXw79Sss3L+H79xlAvPoxXqTH qJCOP3xDXMd310qC4gyyTQD4ijSZ9y8B9PTAXI0uuUkpvx4ARkcsppH70m5G+JYYNreo JCsg== X-Forwarded-Encrypted: i=1; AJvYcCWCEiEzGUivmM73BnlhmMSY9tNyqgDmqmL8EYd/skFseZOW9ASXh0ajyk/9snM5VTH6dOp3bLoGltRENgaj2w==@vger.kernel.org X-Gm-Message-State: AOJu0Yyg9RiwYobSTHr/pdVzKrlKU6KE6Ie5AFGO7sLakV0xUKeJwJop xO1nSGqAhkTqaalIswOC9xtUZzATs3sPCPOm4MN8dUQWOSnuJggdODGb X-Gm-Gg: ASbGncvY/vtjj+/czHd5TORvbSYeLjGuOLP9RQ98flewUDsfSvxzGcN74pl4oE0jNkY MdZGwnlbo7s+DkbRQPrqyKb7vRbkBKk3rRWj7EWo5tVMeYoTzZ0shd/t5InoztYXo0UiP5Fuklh gw11flLXwEXIIvjZCBG34xQZk9HWeVl7SGJnThUI04C/kusNlcwPbFGRujasV6gNFUWHetrZOb7 7nXUUrKkdxtfoTgUIo0R4mSVy589KcIC2vy5lglLroxV8emFtN9m/Ch71YuAlEgILf72Ay0t+zE X020sNsByxyffIALWh8SHMV9RAZZY/T3WtLF4wHTkXa9LLfR3RmemPX7FGKuaIAgeEwirlxAQhl h8mhRa9tDdrb6BCRMk1lhy/jR+68VnSvILCfXKqVpxuWpVT+KRnhfkOvWzQ== X-Google-Smtp-Source: AGHT+IFjutP7obK0TADVT6/jr5reX7v34JHSR9gBVaHhK88qEC2UiRaBIKkiBy1t0yjPHCjcIVALCw== X-Received: by 2002:a17:902:e786:b0:26e:7468:8a99 with SMTP id d9443c01a7336-290272c18e1mr224136745ad.36.1760278824509; Sun, 12 Oct 2025 07:20:24 -0700 (PDT) Received: from shankari-IdeaPad.. ([49.128.169.246]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29034f089a3sm108167325ad.76.2025.10.12.07.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Oct 2025 07:20:24 -0700 (PDT) From: Shankari Anand To: Andreas Hindborg , Jens Axboe , Miguel Ojeda , Alex Gaynor , linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Trevor Gross , Danilo Krummrich , Shankari Anand Subject: [PATCH v2] rust: block: update ARef and AlwaysRefCounted imports from sync::aref Date: Sun, 12 Oct 2025 19:50:12 +0530 Message-Id: <20251012142012.166230-1-shankari.ak0208@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Link: https://github.com/Rust-for-Linux/linux/issues/1173 Signed-off-by: Shankari Anand --- Changelog: v1 -> v2: Rebased it on top of the latest linux-next upstream commit Dropped 1/7 from the subject as it might lead to confusion of it being a series Link of v1: https://lore.kernel.org/lkml/20250716090712.809750-1-shankari.ak0208@gmail.com/ The original patch of moving ARef and AlwaysRefCounted to sync::aref is here: (commit 07dad44aa9a93) https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=07dad44aa9a93b16af19e8609a10b241c352b440 Gradually the re-export from types.rs will be eliminated in the future cycle. --- drivers/block/rnull/rnull.rs | 3 +-- rust/kernel/block/mq.rs | 5 ++--- rust/kernel/block/mq/operations.rs | 4 ++-- rust/kernel/block/mq/request.rs | 8 ++++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/block/rnull/rnull.rs b/drivers/block/rnull/rnull.rs index 1ec694d7f1a6..a9d5e575a2c4 100644 --- a/drivers/block/rnull/rnull.rs +++ b/drivers/block/rnull/rnull.rs @@ -17,8 +17,7 @@ error::Result, pr_info, prelude::*, - sync::Arc, - types::ARef, + sync::{aref::ARef, Arc}, }; use pin_init::PinInit; diff --git a/rust/kernel/block/mq.rs b/rust/kernel/block/mq.rs index 637018ead0ab..1fd0d54dd549 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`] +//! IO requests are passed to the driver as [`kernel::sync::aref::ARef`] //! 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 @@ -61,8 +61,7 @@ //! block::mq::*, //! new_mutex, //! prelude::*, -//! sync::{Arc, Mutex}, -//! types::{ARef, ForeignOwnable}, +//! sync::{aref::ARef, Arc, Mutex}, //! }; //! //! struct MyBlkDevice; diff --git a/rust/kernel/block/mq/operations.rs b/rust/kernel/block/mq/operations.rs index f91a1719886c..8ad46129a52c 100644 --- a/rust/kernel/block/mq/operations.rs +++ b/rust/kernel/block/mq/operations.rs @@ -9,8 +9,8 @@ block::mq::{request::RequestDataWrapper, Request}, error::{from_result, Result}, prelude::*, - sync::Refcount, - types::{ARef, ForeignOwnable}, + sync::{aref::ARef, Refcount}, + types::ForeignOwnable, }; use core::marker::PhantomData; diff --git a/rust/kernel/block/mq/request.rs b/rust/kernel/block/mq/request.rs index c5f1f6b1ccfb..ce3e30c81cb5 100644 --- a/rust/kernel/block/mq/request.rs +++ b/rust/kernel/block/mq/request.rs @@ -8,8 +8,12 @@ bindings, block::mq::Operations, error::Result, - sync::{atomic::Relaxed, Refcount}, - types::{ARef, AlwaysRefCounted, Opaque}, + sync::{ + aref::{ARef, AlwaysRefCounted}, + atomic::Relaxed, + Refcount, + }, + types::Opaque, }; use core::{marker::PhantomData, ptr::NonNull}; base-commit: 2b763d4652393c90eaa771a5164502ec9dd965ae -- 2.34.1