From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9CD5C021AA for ; Wed, 19 Feb 2025 08:38:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4565428020A; Wed, 19 Feb 2025 03:38:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4059B280205; Wed, 19 Feb 2025 03:38:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CE7F28020A; Wed, 19 Feb 2025 03:38:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 08030280205 for ; Wed, 19 Feb 2025 03:38:14 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B91E8B5DA2 for ; Wed, 19 Feb 2025 08:38:13 +0000 (UTC) X-FDA: 83136042066.01.8742AF1 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf23.hostedemail.com (Postfix) with ESMTP id 17983140004 for ; Wed, 19 Feb 2025 08:38:11 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qbUXL5i8; spf=pass (imf23.hostedemail.com: domain of a.hindborg@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=a.hindborg@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739954292; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=f7K0izF/9PGeroYNQaQZxtALZdeMG4IkAozvWOMqwlw=; b=HUX386UWWqCHsbW5+JRgB/88ofPFAc9cIZuhyzvUywrsadIdZ3Um7/1p+qdXNkD8PmSpSQ 87ovKTJOMAJ14JruvzRfJaLLQWHq9m6HG02M16Xb6h6XGPgh2tpvGnLPlL28Zpmjj04Xxr XoOTEkOPqqFZvCOE5ast1NAbYOAifkg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qbUXL5i8; spf=pass (imf23.hostedemail.com: domain of a.hindborg@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=a.hindborg@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739954292; a=rsa-sha256; cv=none; b=0zgmVuIXgd8Q+UXUKK9gOUOHd9CX5q6jtyXMFgjS8TlwIqVDZJbR3Cm73Z9rKrAIz8U2sb brBpYgunmAJGSivrtxgEWc+h2wjXFy6J5qgwBFMf1l810FpbKZ9fWo/Ju/0qJdf+xVxzuq CJEH3Y6DI8YEH0ONn61bN2Mn/DbKyYU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 82167A41F87; Wed, 19 Feb 2025 08:36:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60CE2C4CED1; Wed, 19 Feb 2025 08:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739954291; bh=T2SBPUWU4o/SY8lo2Y5pA5+O8iQ5YR23jNTvXLpfg0I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qbUXL5i83JlMGiSf0xuUuxX4szW1wRCnJvB6H1elLLBnc0kTKxRvS341YhOjtb6KB xC9li10LcSMbfx0OtNl4XwJ9UjYMh0sMXoBit/MvGdveWIvc2TQWu3mDzkKVcaVmS0 ejw05U9O2uFGe6u11N3o7R6ADUZrJ9xKhHLS78Ztj/J0NOyuJrbIdBKB4yQsv+p2hN uJZCEs2zi7y5WFLNKCu7QRz3tF02JeYZkA/tuQJ+rfyn0PVEQVXtZZuyjqX+q4Bh0F Dx1renbf1P4BKCgcIu4hAczAK44TSFlq185ibGMFs5A5CV5PlZfm9O2IO0Qw5Nb+HJ 0KgRWcHZkhNIQ== From: Andreas Hindborg To: "Asahi Lina" Cc: "Alice Ryhl" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?Q?Bj?= =?utf-8?Q?=C3=B6rn?= Roy Baron , "Benno Lossin" , "Trevor Gross" , "Jann Horn" , "Matthew Wilcox" , "Paolo Bonzini" , "Danilo Krummrich" , "Wedson Almeida Filho" , "Valentin Obst" , "Andrew Morton" , , , "Abdiel Janulgue" , , , Subject: Re: [PATCH 1/6] rust: types: Add Ownable/Owned types In-Reply-To: <585deb4e-3d05-488b-80dd-df64a6983d85@asahilina.net> (Asahi Lina's message of "Tue, 04 Feb 2025 04:17:38 +0900") References: <20250202-rust-page-v1-0-e3170d7fe55e@asahilina.net> <20250202-rust-page-v1-1-e3170d7fe55e@asahilina.net> <585deb4e-3d05-488b-80dd-df64a6983d85@asahilina.net> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Wed, 19 Feb 2025 09:34:54 +0100 Message-ID: <87mseie3ip.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 17983140004 X-Stat-Signature: 8i9h6fcbk6uygth5wm5rf9gs6fw9kqi3 X-HE-Tag: 1739954291-826261 X-HE-Meta: U2FsdGVkX1//L64A1/nqb7SuMl/WvdMWf6tL/L48VKXcruTNqE39+XP4zTiKI4zfmHmeK7pbhFpO49P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jUhiO8q1ADFl41Gty+9gY6dobGV3zHBITuxiUoVJvbamfm7TJQQdlc0Jis1MeQvWD1q6s779X3QZGNkSqYNOYfRiHty3xBt2PQ2KAC0/jgQFxN3g1HJs/GkNemxyoxGQWmwd0iq9yZxnGzREdOSD385nY8Ov/szI2MHGE2kDCSQu5ShBm X-Bogosity: Unsure, tests=bogofilter, spamicity=0.500000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: "Asahi Lina" writes: > On 2/4/25 3:17 AM, Alice Ryhl wrote: >> On Mon, Feb 3, 2025 at 3:17=E2=80=AFPM Asahi Lina w= rote: >>> >>> >>> >>> On 2/3/25 6:13 PM, Alice Ryhl wrote: >>>> On Sun, Feb 2, 2025 at 2:06=E2=80=AFPM Asahi Lina = wrote: >>>>> + /// Consumes the `Owned`, returning a raw pointer. >>>>> + /// >>>>> + /// This function does not actually relinquish ownership of the = object. >>>>> + /// After calling this function, the caller is responsible for o= wnership previously managed >>>>> + /// by the `Owned`. >>>>> + #[allow(dead_code)] >>>>> + pub(crate) fn into_raw(me: Self) -> NonNull { >>>> >>>> I would just make these methods public, like the ARef ones. Then you >>>> can drop the #[allow(dead_code)] annotation. >>> >>> Does it make sense to ever have drivers doing this? I feel like these >>> methods should be limited to the kernel crate. >> >> Not having drivers use this is the ideal, but I don't think we should >> always expect it to be possible. The Binder driver has a C component >> for the binderfs component, and it also has some code that's >> essentially an abstraction inside the driver that I was asked to move >> into Binder because it's so specific to Binder that it's not useful >> for anyone else. > > That's fair, I'll make it pub. Also, the kernel crate will split at some point. We might as well have them public now and avoid the churn. Best regards, Andreas Hindborg