From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 848901EB184; Wed, 19 Feb 2025 08:38:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739954291; cv=none; b=dUgkR+fu29MAjjfYAeXFHBwT5W7qf7iygXrRo+x+sE1z57Z0FkX47BIHkCo7LdIrLO+yv7l1x+BeZVqL0j+qS8D4DFavLtHhX290ecfplZFAWFhaTQLyaqU1P1mUsgW43a5gy7dPfL8xVDyHIedf2ANq49E94bK7shK6hShA9EM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739954291; c=relaxed/simple; bh=T2SBPUWU4o/SY8lo2Y5pA5+O8iQ5YR23jNTvXLpfg0I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ewpDEn5hg03aZLC2b33rAf6njeO8YRCOFoU/8e0nxLAHb7tGTiqpUKAcEuuLl9MPVZCxbItQSIHQ03YhObB8vMyokCWkO9Nm7SVYga4Vu4TrJP+5TXvMnwpBonWVpX1sdu8RG0DqUe2uCe709bVKT1KCzIXZXzUNd5M+otBoObg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qbUXL5i8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qbUXL5i8" 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> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "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