From: Danilo Krummrich <dakr@kernel.org>
To: Matthew Maurer <mmaurer@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Sami Tolvanen" <samitolvanen@google.com>,
"Timur Tabi" <ttabi@nvidia.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH WIP 1/2] rust: debugfs: Add interface to build debugfs off pinned objects
Date: Sun, 4 May 2025 18:58:31 +0200 [thread overview]
Message-ID: <aBectw_2jridu43O@polis> (raw)
In-Reply-To: <20250503-debugfs-rust-attach-v1-1-dc37081fbfbc@google.com>
On Sat, May 03, 2025 at 12:43:59AM +0000, Matthew Maurer wrote:
> +/// A DebugFS directory combined with a backing store for data to implement it.
> +#[pin_data]
> +pub struct Values<T> {
> + dir: Dir<'static, false>,
> + // The order here is load-bearing - `dir` must be dropped before `backing`, as files under
> + // `dir` may point into `backing`.
> + #[pin]
> + backing: T,
> + // Since the files present under our directory may point into `backing`, we are `!Unpin`.
> + #[pin]
> + _pin: PhantomPinned,
> +}
This only ever allows attaching data to the root directory, correct? What if I
want to remove (or replace) a file or a subdir? Then I'd be left with the data
for this specific file (or subdir) until the root is finally removed.
It would also require Option<V> (where V is the type of a field in T), if I
don't have an instance of V yet, when the root directory is created.
I think we should store the data per file, rather than per root directory.
next prev parent reply other threads:[~2025-05-04 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-03 0:43 [PATCH WIP 0/2] rust: debugfs: Support attaching data to DebugFS directories Matthew Maurer
2025-05-03 0:43 ` [PATCH WIP 1/2] rust: debugfs: Add interface to build debugfs off pinned objects Matthew Maurer
2025-05-04 16:58 ` Danilo Krummrich [this message]
2025-05-05 17:32 ` Matthew Maurer
2025-05-07 18:16 ` Danilo Krummrich
2025-05-03 0:44 ` [PATCH WIP 2/2] rust: debugfs: Extend sample to use attached data Matthew Maurer
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=aBectw_2jridu43O@polis \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmaurer@google.com \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=samitolvanen@google.com \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
/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).