Re: Rust kernel policy

From: Steven Rostedt
Date: Thu Feb 20 2025 - 10:39:32 EST


On Thu, 20 Feb 2025 09:26:55 +0300
Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> > But we should be encouraging the use of:
> >
> > scoped_guard(mutex)(&my_mutex) {
> > /* Do the work needed for for my_mutex */
> > }
>
> Meh...
>
> with_rcu() {
> }
>
> with_mutex(g_mutex) {
> }
>
> with_spin_lock(g_lock) {
> }
>
> > Which does work out very well. And the fact that the code guarded by the
> > mutex is now also indented, it makes it easier to review.
>
> It only works only for ~1-2 indents then the code flow away :-(

Then perhaps you should start using helper functions ;-)

-- Steve