rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Maurer <mmaurer@google.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: gregkh@linuxfoundation.org, rafael@kernel.org, ojeda@kernel.org,
	 alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
	 bjorn3_gh@protonmail.com, lossin@kernel.org,
	a.hindborg@kernel.org,  aliceryhl@google.com, tmgross@umich.edu,
	rust-for-linux@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/7] rust: debugfs: support blobs from smart pointers
Date: Fri, 3 Oct 2025 16:36:04 -0700	[thread overview]
Message-ID: <CAGSQo01ssCYA2vxkbDmEnoSegH5ks_V=07LC3yE2Zp4eFDXiFw@mail.gmail.com> (raw)
In-Reply-To: <DD92QHU14T9S.14AE7Z1UWJ6ZT@kernel.org>

>
> I think this way around is not compatible with scoped API.
>
I thought you'd just be able to deref inside the callback, but perhaps
I'm wrong. I'll try to find a chance to pull down the patch and check.

> >> +// Delegate for `Vec<T, A>`: Support a `Vec<T, A>` with an outer lock.
> >> +impl<T, A> BinaryReaderMut for Vec<T, A>
> >> +where
> >> +    T: AsBytes + FromBytes,
> >> +    A: Allocator,
> >> +{
> >> +    fn read_from_slice_mut(
> >> +        &mut self,
> >> +        reader: &mut UserSliceReader,
> >> +        offset: usize,
> >> +    ) -> Result<usize> {
> >> +        let slice = self.as_mut_slice();
> >> +
> >
> > Nit: This is safe, but it also requires `FromBytes`, and is &mut, &mut
>
> It already requires T: AsBytes + FromBytes above. Or do you mean something else?

I mean the safety comment. Your code is right, the comment needs to be updated.

  reply	other threads:[~2025-10-03 23:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-03 22:26 [PATCH 0/7] Binary Large Objects for Rust DebugFS Danilo Krummrich
2025-10-03 22:26 ` [PATCH 1/7] rust: uaccess: add UserSliceReader::read_slice_partial() Danilo Krummrich
2025-10-17 11:11   ` Alice Ryhl
2025-10-17 11:50     ` Danilo Krummrich
2025-10-03 22:26 ` [PATCH 2/7] rust: uaccess: add UserSliceWriter::write_slice_partial() Danilo Krummrich
2025-10-03 22:26 ` [PATCH 3/7] rust: debugfs: support for binary large objects Danilo Krummrich
2025-10-17 12:59   ` Alice Ryhl
2025-10-17 14:37     ` Danilo Krummrich
2025-10-17 14:53       ` Danilo Krummrich
2025-10-19  9:44         ` Alice Ryhl
2025-10-19 12:01           ` Danilo Krummrich
2025-10-20  8:12             ` Alice Ryhl
2025-10-20  9:40               ` Danilo Krummrich
2025-10-20  9:42                 ` Alice Ryhl
2025-10-20  9:49                   ` Danilo Krummrich
2025-10-19  9:50       ` Alice Ryhl
2025-10-19 11:24         ` Danilo Krummrich
2025-10-20  8:13           ` Alice Ryhl
2025-10-20  9:35             ` Danilo Krummrich
2025-10-20  9:39               ` Alice Ryhl
2025-10-20  9:41                 ` Danilo Krummrich
2025-10-03 22:26 ` [PATCH 4/7] rust: debugfs: support blobs from smart pointers Danilo Krummrich
2025-10-03 23:12   ` Matthew Maurer
2025-10-03 23:26     ` Danilo Krummrich
2025-10-03 23:36       ` Matthew Maurer [this message]
2025-10-03 22:26 ` [PATCH 5/7] samples: rust: debugfs: add example for blobs Danilo Krummrich
2025-10-20 10:01   ` Alice Ryhl
2025-10-03 22:26 ` [PATCH 6/7] rust: debugfs: support binary large objects for ScopedDir Danilo Krummrich
2025-10-17 13:00   ` Alice Ryhl
2025-10-17 14:55     ` Danilo Krummrich
2025-10-03 22:26 ` [PATCH 7/7] samples: rust: debugfs_scoped: add example for blobs Danilo Krummrich
2025-10-20 10:02   ` Alice Ryhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGSQo01ssCYA2vxkbDmEnoSegH5ks_V=07LC3yE2Zp4eFDXiFw@mail.gmail.com' \
    --to=mmaurer@google.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).