]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: target: Create and use macro helpers for per-CPU stats
authorMike Christie <michael.christie@oracle.com>
Wed, 17 Sep 2025 22:12:54 +0000 (17:12 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 3 Nov 2025 03:06:11 +0000 (22:06 -0500)
commited6b97a79577db9bf9d7b21fd623f24f499e3acc
tree0b061c38daa56bdf33d1aa1d925f472bdb6ffca9
parent95aa2041c654161d1b5c1eca5379d67d91ef1cf2
scsi: target: Create and use macro helpers for per-CPU stats

Create some macros to reduce code duplication for when we handle per-CPU
stats. Convert the existing LUN and auth cases.

Note: This is similar to percpu_counters but they only support s64 since
they are also used for non-stat counters where you need to handle/prevent
rollover more gracefully. Our use is just for stats where the spec
defines u64 use plus we already have some files exporting u64 values so
it's not possible to directly use percpu_counters.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Link: https://patch.msgid.link/20250917221338.14813-3-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_stat.c