[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DC5JSHSVPY3P.2HXRIGE8IZOIE@kernel.org>
Date: Mon, 18 Aug 2025 14:21:25 +0200
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>
Cc: <akpm@...ux-foundation.org>, <ojeda@...nel.org>,
<alex.gaynor@...il.com>, <boqun.feng@...il.com>, <gary@...yguo.net>,
<bjorn3_gh@...tonmail.com>, <lossin@...nel.org>, <a.hindborg@...nel.org>,
<tmgross@...ch.edu>, <abdiel.janulgue@...il.com>, <acourbot@...dia.com>,
<jgg@...pe.ca>, <lyude@...hat.com>, <robin.murphy@....com>,
<daniel.almeida@...labora.com>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] rust: scatterlist: Add type-state abstraction for
sg_table
On Mon Aug 18, 2025 at 1:16 PM CEST, Danilo Krummrich wrote:
> On Mon Aug 18, 2025 at 11:52 AM CEST, Alice Ryhl wrote:
>> On Fri, Aug 15, 2025 at 07:10:03PM +0200, Danilo Krummrich wrote:
>>> +impl<P> Owned<P>
>>> +where
>>> + for<'a> P: page::AsPageIter<Iter<'a> = VmallocPageIter<'a>> + 'static,
>>
>> If you specifically require the iterator type to be VmallocPageIter,
>> then I would hard-code that in the trait instead of specifying it here.
>
> I do not follow, hard-code in which trait?
>
>> But I think you just want `P: AsPageIter`.
>
> Yeah, I thought for now it's probably good enough to require VmallocPageIter and
> revisit once we get more implementors of AsPageIter, but I think we can also do
> it right away.
>
> I think we'd need a trait PageIterator, which implements page_count(), since we
> technically can't rely on Iterator::size_hint(). Though, in this case I think we
> can also just make AsPageIter::Iter: ExactSizeIterator?
Forgot to mention this [1] as for why we expect VmallocPageIter (at least for
now).
[1] https://lore.kernel.org/rust-for-linux/958ef505-8713-4f88-9f24-5971ce8a08ce@kernel.org/
Powered by blists - more mailing lists