diff mbox series

[2/6] block: use bio_{wouldblock,io}_error in direct_make_request

Message ID 20200228150518.10496-3-guoqing.jiang@cloud.ionos.com (mailing list archive)
State New, archived
Headers show
Series Some cleanups for blk-core.c and blk-flush.c | expand

Commit Message

Guoqing Jiang Feb. 28, 2020, 3:05 p.m. UTC
Use the two functions to simplify code.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
---
 block/blk-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Nikolay Borisov Feb. 28, 2020, 10:37 p.m. UTC | #1
On 28.02.20 г. 17:05 ч., Guoqing Jiang wrote:
> Use the two functions to simplify code.
> 
> Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
> ---
>  block/blk-core.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index fd43266029be..6d36c2ad40ba 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -1121,10 +1121,9 @@ blk_qc_t direct_make_request(struct bio *bio)
>  
>  	if (unlikely(blk_queue_enter(q, nowait ? BLK_MQ_REQ_NOWAIT : 0))) {
>  		if (nowait && !blk_queue_dying(q))
> -			bio->bi_status = BLK_STS_AGAIN;
> +			bio_wouldblock_error(bio);
>  		else
> -			bio->bi_status = BLK_STS_IOERR;
> -		bio_endio(bio);
> +			bio_io_error(bio);
>  		return BLK_QC_T_NONE;
>  	}
>  
> 

The code is functionally identical so:

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Bart Van Assche Feb. 29, 2020, 2:26 a.m. UTC | #2
On 2020-02-28 07:05, Guoqing Jiang wrote:
> Use the two functions to simplify code.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Chaitanya Kulkarni Feb. 29, 2020, 11:11 p.m. UTC | #3
Neat, looks good to me.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
On 02/28/2020 07:06 AM, Guoqing Jiang wrote:
> Use the two functions to simplify code.
>
> Signed-off-by: Guoqing Jiang<guoqing.jiang@cloud.ionos.com>
diff mbox series

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index fd43266029be..6d36c2ad40ba 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1121,10 +1121,9 @@  blk_qc_t direct_make_request(struct bio *bio)
 
 	if (unlikely(blk_queue_enter(q, nowait ? BLK_MQ_REQ_NOWAIT : 0))) {
 		if (nowait && !blk_queue_dying(q))
-			bio->bi_status = BLK_STS_AGAIN;
+			bio_wouldblock_error(bio);
 		else
-			bio->bi_status = BLK_STS_IOERR;
-		bio_endio(bio);
+			bio_io_error(bio);
 		return BLK_QC_T_NONE;
 	}