diff options
Diffstat (limited to 'include/linux/xarray.h')
-rw-r--r-- | include/linux/xarray.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/xarray.h b/include/linux/xarray.h new file mode 100644 index 000000000000..2dfc8006fe64 --- /dev/null +++ b/include/linux/xarray.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
2 | #ifndef _LINUX_XARRAY_H | ||
3 | #define _LINUX_XARRAY_H | ||
4 | /* | ||
5 | * eXtensible Arrays | ||
6 | * Copyright (c) 2017 Microsoft Corporation | ||
7 | * Author: Matthew Wilcox <mawilcox@microsoft.com> | ||
8 | */ | ||
9 | |||
10 | #include <linux/spinlock.h> | ||
11 | |||
12 | #define xa_trylock(xa) spin_trylock(&(xa)->xa_lock) | ||
13 | #define xa_lock(xa) spin_lock(&(xa)->xa_lock) | ||
14 | #define xa_unlock(xa) spin_unlock(&(xa)->xa_lock) | ||
15 | #define xa_lock_bh(xa) spin_lock_bh(&(xa)->xa_lock) | ||
16 | #define xa_unlock_bh(xa) spin_unlock_bh(&(xa)->xa_lock) | ||
17 | #define xa_lock_irq(xa) spin_lock_irq(&(xa)->xa_lock) | ||
18 | #define xa_unlock_irq(xa) spin_unlock_irq(&(xa)->xa_lock) | ||
19 | #define xa_lock_irqsave(xa, flags) \ | ||
20 | spin_lock_irqsave(&(xa)->xa_lock, flags) | ||
21 | #define xa_unlock_irqrestore(xa, flags) \ | ||
22 | spin_unlock_irqrestore(&(xa)->xa_lock, flags) | ||
23 | |||
24 | #endif /* _LINUX_XARRAY_H */ | ||