diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-11 15:15:38 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-20 19:26:31 -0500 |
| commit | f9d6966b7f4182f612208f9dad9e2cfaaf667ba3 (patch) | |
| tree | d33c7d6d74661490e84970d68957fc7f804a3bcf /include/linux/refcount.h | |
| parent | 1ef83969bb12e594fe44ceba406095e80a824c91 (diff) | |
refcount: Split out refcount_types.h
More trimming of sched.h dependencies.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'include/linux/refcount.h')
| -rw-r--r-- | include/linux/refcount.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/include/linux/refcount.h b/include/linux/refcount.h index a62fcca97486..85c6df0d1bef 100644 --- a/include/linux/refcount.h +++ b/include/linux/refcount.h @@ -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) |
