summaryrefslogtreecommitdiffstats
path: root/include/linux/xarray.h
diff options
context:
space:
mode:
authorZhi Wang <zhi.a.wang@intel.com>2018-05-14 05:19:07 +0800
committerZhi Wang <zhi.a.wang@intel.com>2018-05-14 05:22:01 +0800
commitbba9525520b6028ecbe7486e13216e9ede8636be (patch)
treef82f4f2adecf6f97933c88050682d44336db783e /include/linux/xarray.h
parentcb8ba171ae6c1e4f5fa027162c06d50fc2b43055 (diff)
parent0c79f9cb77eae28d48a4f9fc1b3341aacbbd260c (diff)
downloadcachepc-linux-bba9525520b6028ecbe7486e13216e9ede8636be.tar.gz
cachepc-linux-bba9525520b6028ecbe7486e13216e9ede8636be.zip
Merge branch 'drm-intel-next-queued' into gvt-next
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Diffstat (limited to 'include/linux/xarray.h')
-rw-r--r--include/linux/xarray.h24
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 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+#ifndef _LINUX_XARRAY_H
+#define _LINUX_XARRAY_H
+/*
+ * eXtensible Arrays
+ * Copyright (c) 2017 Microsoft Corporation
+ * Author: Matthew Wilcox <mawilcox@microsoft.com>
+ */
+
+#include <linux/spinlock.h>
+
+#define xa_trylock(xa) spin_trylock(&(xa)->xa_lock)
+#define xa_lock(xa) spin_lock(&(xa)->xa_lock)
+#define xa_unlock(xa) spin_unlock(&(xa)->xa_lock)
+#define xa_lock_bh(xa) spin_lock_bh(&(xa)->xa_lock)
+#define xa_unlock_bh(xa) spin_unlock_bh(&(xa)->xa_lock)
+#define xa_lock_irq(xa) spin_lock_irq(&(xa)->xa_lock)
+#define xa_unlock_irq(xa) spin_unlock_irq(&(xa)->xa_lock)
+#define xa_lock_irqsave(xa, flags) \
+ spin_lock_irqsave(&(xa)->xa_lock, flags)
+#define xa_unlock_irqrestore(xa, flags) \
+ spin_unlock_irqrestore(&(xa)->xa_lock, flags)
+
+#endif /* _LINUX_XARRAY_H */