aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2020-01-17 12:36:32 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2020-01-17 22:32:17 -0500
commit82a958497dc9120e0e8043da82273baedd255aaf (patch)
tree50544f7944467f664903075d28f8dd6d4153c34a
parent6b81141deb7358dbd64ce3e793cd1e3f5939f807 (diff)
XArray: Add wrappers for nested spinlocks
Some users need to take an xarray lock while holding another xarray lock. Reported-by: Doug Gilbert <dgilbert@interlog.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
-rw-r--r--include/linux/xarray.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/xarray.h b/include/linux/xarray.h
index 86eecbd98e84..736afd3aa56f 100644
--- a/include/linux/xarray.h
+++ b/include/linux/xarray.h
@@ -508,6 +508,14 @@ static inline bool xa_marked(const struct xarray *xa, xa_mark_t mark)
spin_lock_irqsave(&(xa)->xa_lock, flags)
#define xa_unlock_irqrestore(xa, flags) \
spin_unlock_irqrestore(&(xa)->xa_lock, flags)
+#define xa_lock_nested(xa, subclass) \
+ spin_lock_nested(&(xa)->xa_lock, subclass)
+#define xa_lock_bh_nested(xa, subclass) \
+ spin_lock_bh_nested(&(xa)->xa_lock, subclass)
+#define xa_lock_irq_nested(xa, subclass) \
+ spin_lock_irq_nested(&(xa)->xa_lock, subclass)
+#define xa_lock_irqsave_nested(xa, flags, subclass) \
+ spin_lock_irqsave_nested(&(xa)->xa_lock, flags, subclass)
/*
* Versions of the normal API which require the caller to hold the