Commit e7e5a051 authored by Alice Ryhl's avatar Alice Ryhl
Browse files

FROMGIT: rust: sync: Add accessor for the lock behind a given guard



In order to assert a particular `Guard` is associated with a particular
`Lock`, add an accessor to obtain a reference to the underlying `Lock`
of a `Guard`.

Binder needs this assertion to ensure unsafe list operations are done
with the correct lock held.

[Boqun: Capitalize the title and reword the commit log]

Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarFiona Behrens <me@kloenk.dev>
Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250205-guard-get-lock-v2-1-ba32a8c1d5b7@google.com

Bug: 388786466
(cherry picked from commit 84f788fe93eb1311824d6853595baa50f3ccd175
 git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git

 lockdep-for-tip)
Change-Id: Ib67020b20ed1ac071e0aeaa0f702553dc915aed0
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent 1a35c808
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment