Re: [PATCH 3/4] block: remove a pointless queue enter pair in blk_mq_alloc_request_hctx

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

 



On 13/05/2020 13:04, Christoph Hellwig wrote:
>  	rq = blk_mq_get_request(q, NULL, &alloc_data);
> -	blk_queue_exit(q);
> -
> -	if (!rq) {
> -		blk_queue_exit(q);
> -		return ERR_PTR(-EWOULDBLOCK);
> -	}
> +	if (!rq)
> +		goto out_queue_exit;
>  
>  	return rq;
> +out_queue_exit:
> +	blk_queue_exit(q);
> +	return ERR_PTR(ret);

I know success handling is discouraged in the kernel, but I think 

	rq = blk_mq_get_request(q, NULL, &alloc_data);
	if (rq)
		return rq;

out_queue_exit:
	blk_queue_exit(q);
	return ERR_PTR(ret);

looks nicer, doesn't it?	




[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