Message ID | 20231215171020.687342-2-bigeasy@linutronix.de (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | locking: Introduce nested-BH locking. | expand |
On Fri, 2023-12-15 at 18:07 +0100, Sebastian Andrzej Siewior wrote: > Introduce lock guard definition for local_lock_t. There are no users > yet. > > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> > --- > include/linux/local_lock.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/include/linux/local_lock.h b/include/linux/local_lock.h > index e55010fa73296..706c4b65d9449 100644 > --- a/include/linux/local_lock.h > +++ b/include/linux/local_lock.h > @@ -51,4 +51,15 @@ > #define local_unlock_irqrestore(lock, flags) \ > __local_unlock_irqrestore(lock, flags) > > +DEFINE_LOCK_GUARD_1(local_lock, local_lock_t, > + local_lock(_T->lock), > + local_unlock(_T->lock)) > +DEFINE_LOCK_GUARD_1(local_lock_irq, local_lock_t, > + local_lock_irq(_T->lock), > + local_unlock_irq(_T->lock)) DEFINE_GUARD should fit for the 2 above, right? Cheers, Paolo
On 2023-12-18 09:16:49 [+0100], Paolo Abeni wrote: > > --- a/include/linux/local_lock.h > > +++ b/include/linux/local_lock.h > > @@ -51,4 +51,15 @@ > > #define local_unlock_irqrestore(lock, flags) \ > > __local_unlock_irqrestore(lock, flags) > > > > +DEFINE_LOCK_GUARD_1(local_lock, local_lock_t, > > + local_lock(_T->lock), > > + local_unlock(_T->lock)) > > +DEFINE_LOCK_GUARD_1(local_lock_irq, local_lock_t, > > + local_lock_irq(_T->lock), > > + local_unlock_irq(_T->lock)) > > DEFINE_GUARD should fit for the 2 above, right? Yes, that will work. Let me update it. > Cheers, > > Paolo Sebastian
diff --git a/include/linux/local_lock.h b/include/linux/local_lock.h index e55010fa73296..706c4b65d9449 100644 --- a/include/linux/local_lock.h +++ b/include/linux/local_lock.h @@ -51,4 +51,15 @@ #define local_unlock_irqrestore(lock, flags) \ __local_unlock_irqrestore(lock, flags) +DEFINE_LOCK_GUARD_1(local_lock, local_lock_t, + local_lock(_T->lock), + local_unlock(_T->lock)) +DEFINE_LOCK_GUARD_1(local_lock_irq, local_lock_t, + local_lock_irq(_T->lock), + local_unlock_irq(_T->lock)) +DEFINE_LOCK_GUARD_1(local_lock_irqsave, local_lock_t, + local_lock_irqsave(_T->lock, _T->flags), + local_unlock_irqrestore(_T->lock, _T->flags), + unsigned long flags) + #endif
Introduce lock guard definition for local_lock_t. There are no users yet. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- include/linux/local_lock.h | 11 +++++++++++ 1 file changed, 11 insertions(+)