Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refcount: Split out refcount_types.h

More trimming of sched.h dependencies.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

+22 -13
+1 -12
include/linux/refcount.h
··· 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 - /** 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 103 115 104 #define REFCOUNT_INIT(n) { .refs = ATOMIC_INIT(n), } 116 105 #define REFCOUNT_MAX INT_MAX
+19
include/linux/refcount_types.h
··· 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 */
+1 -1
include/linux/sched.h
··· 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>
+1
include/linux/sched/task.h
··· 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