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

Configure Feed

Select the types of activity you want to include in your feed.

ublk: return early if blk_should_fake_timeout()

Make the unlikely case blk_should_fake_timeout() return early to reduce
the indentation of the successful path.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250620151008.3976463-11-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
7ab74108 763ff02c

+3 -2
+3 -2
drivers/block/ublk_drv.c
··· 2161 2161 if (req_op(req) == REQ_OP_ZONE_APPEND) 2162 2162 req->__sector = ub_cmd->zone_append_lba; 2163 2163 2164 - if (likely(!blk_should_fake_timeout(req->q))) 2165 - ublk_put_req_ref(ubq, io, req); 2164 + if (unlikely(blk_should_fake_timeout(req->q))) 2165 + return 0; 2166 2166 2167 + ublk_put_req_ref(ubq, io, req); 2167 2168 return 0; 2168 2169 } 2169 2170