mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 03:48:59 +00:00
futex: Use atomic64_inc_return() in get_inode_sequence_number()
Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref) to use optimized implementation and ease register pressure around the primitive for targets that implement optimized variant. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: André Almeida <andrealmeid@igalia.com> Link: https://lore.kernel.org/all/20241010071023.21913-1-ubizjak@gmail.com
This commit is contained in:
parent
823a566221
commit
19298f4869
@ -181,7 +181,7 @@ static u64 get_inode_sequence_number(struct inode *inode)
|
||||
return old;
|
||||
|
||||
for (;;) {
|
||||
u64 new = atomic64_add_return(1, &i_seq);
|
||||
u64 new = atomic64_inc_return(&i_seq);
|
||||
if (WARN_ON_ONCE(!new))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user