diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-17 17:08:33 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-08-17 17:11:27 -0400 |
commit | 505c326cbe091b105dbdfbe66dae4ad6ee424906 (patch) | |
tree | a7bf3a8ebac5ef648d48489eb87964e79bb2e261 /include/linux/sched.h | |
parent | 4d04fe42623a2f2b91a75cfa3d3503ab88e48acc (diff) |
Update bcachefs sources to a8115093df bcachefs: Fix divide by zero in rebalance_work()
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index c5c8e3ac..825eea5c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -107,7 +107,12 @@ extern __thread struct task_struct *current; #define set_current_state(state_value) \ smp_store_mb(current->state, (state_value)) -#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) +static inline struct task_struct *get_task_struct(struct task_struct *task) +{ + atomic_inc(&task->usage); + return task; + +} extern void __put_task_struct(struct task_struct *t); |