Re: [PATCH v5 17/18] rust: sync: Add SpinLockIrq

Boqun Feng <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Mon, Aug 10, 2026 at 11:02:13AM +0200, Peter Zijlstra wrote:
> On Fri, Aug 07, 2026 at 12:02:14AM -0700, Boqun Feng wrote:
> 
> > -pub use lock::spinlock::{new_spinlock, SpinLock, SpinLockGuard};
> > +pub use lock::spinlock::{
> > +    new_spinlock,
> > +    new_spinlock_irq,
> > +    SpinLock,
> > +    SpinLockGuard,
> > +    SpinLockIrq,
> > +    SpinLockIrqGuard, //
> > +};
> 
> What's this new_spinlock* stuff about? It has sensible naming; unlike
> that CameCase nonsense the rest has.

They're the counter part of *spin_lock_init() in C side, similar as C,
they need to macros to expand at callsite for lock class key generation.
Types and Traits use CameCase, and macros and functions use snake_case.

Regards,
Boqun
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.