[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2E3FBB87-EFCE-425E-8ED8-6EE0EF19C6F2@collabora.com>
Date: Tue, 19 Aug 2025 14:22:31 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Andrew Ballance <andrewjballance@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
linux-kernel@...r.kernel.org,
maple-tree@...ts.infradead.org,
rust-for-linux@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH v2 3/5] rust: maple_tree: add MapleTree::lock() and load()
Ah, something else,
[…]
>> + /// Load the value at the given index.
>> + ///
>> + /// # Examples
>> + ///
>> + /// Read the value while holding the spinlock.
>> + ///
>> + /// ```
>> + /// use kernel::maple_tree::{MapleTree, InsertErrorKind};
>> + ///
>> + /// let tree = KBox::pin_init(MapleTree::<KBox<i32>>::new(), GFP_KERNEL)?;
>> + ///
>> + /// let ten = KBox::new(10, GFP_KERNEL)?;
>> + /// let twenty = KBox::new(20, GFP_KERNEL)?;
>> + /// tree.insert(100, ten, GFP_KERNEL)?;
>> + /// tree.insert(200, twenty, GFP_KERNEL)?;
>> + ///
>> + /// let mut lock = tree.lock();
>> + /// assert_eq!(lock.load(100), Some(&mut 10));
>> + /// assert_eq!(lock.load(200), Some(&mut 20));
>> + /// assert_eq!(lock.load(300), None);
>> + /// # Ok::<_, Error>(())
>> + /// ```
>> + ///
>> + /// Increment refcount while holding spinlock and read afterwards.
This sentence can be improved.
Powered by blists - more mailing lists