[PATCH RFC 2/4] types: add rcuref_long_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a variant of rcuref that operates on atomic_long_t instead of
atomic_t so it can be used for data structures that require
atomic_long_t.

Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
---
 include/linux/types.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/types.h b/include/linux/types.h
index 2bc8766ba20cab014a380f02e5644bd0d772ec67..b10bf351f3e4d1f1c1ca16248199470306de4aa0 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -190,6 +190,16 @@ typedef struct {
 
 #define RCUREF_INIT(i)	{ .refcnt = ATOMIC_INIT(i - 1) }
 
+typedef struct {
+#ifdef CONFIG_64BIT
+	atomic64_t refcnt;
+#else
+	atomic_t refcnt;
+#endif
+} rcuref_long_t;
+
+#define RCUREF_LONG_INIT(i)	{ .refcnt = ATOMIC_LONG_INIT(i - 1) }
+
 struct list_head {
 	struct list_head *next, *prev;
 };

-- 
2.45.2





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux