Loading include/linux/refcount.h +1 −12 Original line number Diff line number Diff line Loading @@ -96,22 +96,11 @@ #include <linux/bug.h> #include <linux/compiler.h> #include <linux/limits.h> #include <linux/refcount_types.h> #include <linux/spinlock_types.h> struct mutex; /** * typedef refcount_t - variant of atomic_t specialized for reference counts * @refs: atomic_t counter field * * The counter saturates at REFCOUNT_SATURATED and will not move once * there. This avoids wrapping the counter and causing 'spurious' * use-after-free bugs. */ typedef struct refcount_struct { atomic_t refs; } refcount_t; #define REFCOUNT_INIT(n) { .refs = ATOMIC_INIT(n), } #define REFCOUNT_MAX INT_MAX #define REFCOUNT_SATURATED (INT_MIN / 2) Loading include/linux/refcount_types.h 0 → 100644 +19 −0 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_REFCOUNT_TYPES_H #define _LINUX_REFCOUNT_TYPES_H #include <linux/types.h> /** * typedef refcount_t - variant of atomic_t specialized for reference counts * @refs: atomic_t counter field * * The counter saturates at REFCOUNT_SATURATED and will not move once * there. This avoids wrapping the counter and causing 'spurious' * use-after-free bugs. */ typedef struct refcount_struct { atomic_t refs; } refcount_t; #endif /* _LINUX_REFCOUNT_TYPES_H */ include/linux/sched.h +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ #include <linux/seccomp.h> #include <linux/nodemask_types.h> #include <linux/rcupdate.h> #include <linux/refcount.h> #include <linux/refcount_types.h> #include <linux/resource.h> #include <linux/latencytop.h> #include <linux/sched/prio.h> Loading include/linux/sched/task.h +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ * functionality: */ #include <linux/refcount.h> #include <linux/sched.h> #include <linux/uaccess.h> Loading Loading
include/linux/refcount.h +1 −12 Original line number Diff line number Diff line Loading @@ -96,22 +96,11 @@ #include <linux/bug.h> #include <linux/compiler.h> #include <linux/limits.h> #include <linux/refcount_types.h> #include <linux/spinlock_types.h> struct mutex; /** * typedef refcount_t - variant of atomic_t specialized for reference counts * @refs: atomic_t counter field * * The counter saturates at REFCOUNT_SATURATED and will not move once * there. This avoids wrapping the counter and causing 'spurious' * use-after-free bugs. */ typedef struct refcount_struct { atomic_t refs; } refcount_t; #define REFCOUNT_INIT(n) { .refs = ATOMIC_INIT(n), } #define REFCOUNT_MAX INT_MAX #define REFCOUNT_SATURATED (INT_MIN / 2) Loading
include/linux/refcount_types.h 0 → 100644 +19 −0 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ #ifndef _LINUX_REFCOUNT_TYPES_H #define _LINUX_REFCOUNT_TYPES_H #include <linux/types.h> /** * typedef refcount_t - variant of atomic_t specialized for reference counts * @refs: atomic_t counter field * * The counter saturates at REFCOUNT_SATURATED and will not move once * there. This avoids wrapping the counter and causing 'spurious' * use-after-free bugs. */ typedef struct refcount_struct { atomic_t refs; } refcount_t; #endif /* _LINUX_REFCOUNT_TYPES_H */
include/linux/sched.h +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ #include <linux/seccomp.h> #include <linux/nodemask_types.h> #include <linux/rcupdate.h> #include <linux/refcount.h> #include <linux/refcount_types.h> #include <linux/resource.h> #include <linux/latencytop.h> #include <linux/sched/prio.h> Loading
include/linux/sched/task.h +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ * functionality: */ #include <linux/refcount.h> #include <linux/sched.h> #include <linux/uaccess.h> Loading