Re: [PATCH v2 10/14] ublk: return early if blk_should_fake_timeout()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 20, 2025 at 09:10:04AM -0600, Caleb Sander Mateos wrote:
> 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@xxxxxxxxxxxxxxx>
> ---
>  drivers/block/ublk_drv.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
> index 11aa65f36ec9..f53618391141 100644
> --- a/drivers/block/ublk_drv.c
> +++ b/drivers/block/ublk_drv.c
> @@ -2143,13 +2143,14 @@ static int ublk_commit_and_fetch(const struct ublk_queue *ubq,
>  	io->res = ub_cmd->result;
>  
>  	if (req_op(req) == REQ_OP_ZONE_APPEND)
>  		req->__sector = ub_cmd->zone_append_lba;
>  
> -	if (likely(!blk_should_fake_timeout(req->q)))
> -		ublk_put_req_ref(ubq, io, req);
> +	if (unlikely(blk_should_fake_timeout(req->q)))
> +		return 0;
>  
> +	ublk_put_req_ref(ubq, io, req);
>  	return 0;
>  }

Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx>

Thanks,
Ming





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux