File tree Expand file tree Collapse file tree 4 files changed +22
-13
lines changed Expand file tree Collapse file tree 4 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 96
96
#include <linux/bug.h>
97
97
#include <linux/compiler.h>
98
98
#include <linux/limits.h>
99
+ #include <linux/refcount_types.h>
99
100
#include <linux/spinlock_types.h>
100
101
101
102
struct mutex ;
102
103
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
-
115
104
#define REFCOUNT_INIT (n ) { .refs = ATOMIC_INIT(n), }
116
105
#define REFCOUNT_MAX INT_MAX
117
106
#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 22
22
#include <linux/seccomp.h>
23
23
#include <linux/nodemask_types.h>
24
24
#include <linux/rcupdate.h>
25
- #include <linux/refcount .h>
25
+ #include <linux/refcount_types .h>
26
26
#include <linux/resource.h>
27
27
#include <linux/latencytop.h>
28
28
#include <linux/sched/prio.h>
Original file line number Diff line number Diff line change 7
7
* functionality:
8
8
*/
9
9
10
+ #include <linux/refcount.h>
10
11
#include <linux/sched.h>
11
12
#include <linux/uaccess.h>
12
13
You can’t perform that action at this time.
0 commit comments