blktrace: only calculate trace length once
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Wed, 22 Oct 2025 11:41:00 +0000 (13:41 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 22 Oct 2025 17:14:05 +0000 (11:14 -0600)
commita65988a0ad047dbdb8a1eb6f07540b980858b522
treebb3b0e6688350ce468345973235e0bec6177a7b6
parent5c5028ee594ce5f907ca6ad1c32cca6a15098464
blktrace: only calculate trace length once

De-duplicate the calculation of the trace length instead of doing the
calculation twice, once for calling trace_buffer_lock_reserve() and once
for calling relay_reserve().

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
kernel/trace/blktrace.c