File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9696#include <linux/bug.h>
9797#include <linux/compiler.h>
9898#include <linux/limits.h>
99+ #include <linux/refcount_types.h>
99100#include <linux/spinlock_types.h>
100101
101102struct mutex ;
102103
103- /**
104- * typedef refcount_t - variant of atomic_t specialized for reference counts
105- * @refs: atomic_t counter field
106- *
107- * The counter saturates at REFCOUNT_SATURATED and will not move once
108- * there. This avoids wrapping the counter and causing 'spurious'
109- * use-after-free bugs.
110- */
111- typedef struct refcount_struct {
112- atomic_t refs ;
113- } refcount_t ;
114-
115104#define REFCOUNT_INIT (n ) { .refs = ATOMIC_INIT(n), }
116105#define REFCOUNT_MAX INT_MAX
117106#define REFCOUNT_SATURATED (INT_MIN / 2)
Original file line number Diff line number Diff line change 1+ /* SPDX-License-Identifier: GPL-2.0 */
2+ #ifndef _LINUX_REFCOUNT_TYPES_H
3+ #define _LINUX_REFCOUNT_TYPES_H
4+
5+ #include <linux/types.h>
6+
7+ /**
8+ * typedef refcount_t - variant of atomic_t specialized for reference counts
9+ * @refs: atomic_t counter field
10+ *
11+ * The counter saturates at REFCOUNT_SATURATED and will not move once
12+ * there. This avoids wrapping the counter and causing 'spurious'
13+ * use-after-free bugs.
14+ */
15+ typedef struct refcount_struct {
16+ atomic_t refs ;
17+ } refcount_t ;
18+
19+ #endif /* _LINUX_REFCOUNT_TYPES_H */
Original file line number Diff line number Diff line change 2222#include <linux/seccomp.h>
2323#include <linux/nodemask_types.h>
2424#include <linux/rcupdate.h>
25- #include <linux/refcount .h>
25+ #include <linux/refcount_types .h>
2626#include <linux/resource.h>
2727#include <linux/latencytop.h>
2828#include <linux/sched/prio.h>
Original file line number Diff line number Diff line change 77 * functionality:
88 */
99
10+ #include <linux/refcount.h>
1011#include <linux/sched.h>
1112#include <linux/uaccess.h>
1213
You can’t perform that action at this time.
0 commit comments