Re: Rust kernel policy

Steven Rostedt
2025-02-20T15:37:03Z

On Thu, 20 Feb 2025 09:26:55 +0300
Alexey Dobriyan <adobriyan@gmail.com> 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