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

md/raid5-ppl: Use atomic64_inc_return() in ppl_new_iounit()

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>
Cc: Song Liu <song@kernel.org>
Cc: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Link: https://lore.kernel.org/r/20241007084831.48067-1-ubizjak@gmail.com
Signed-off-by: Song Liu <song@kernel.org>

authored by

Uros Bizjak and committed by
Song Liu
1e79892e 2a8f6153

+1 -1
+1 -1
drivers/md/raid5-ppl.c
··· 258 258 memset(pplhdr->reserved, 0xff, PPL_HDR_RESERVED); 259 259 pplhdr->signature = cpu_to_le32(ppl_conf->signature); 260 260 261 - io->seq = atomic64_add_return(1, &ppl_conf->seq); 261 + io->seq = atomic64_inc_return(&ppl_conf->seq); 262 262 pplhdr->generation = cpu_to_le64(io->seq); 263 263 264 264 return io;