diff mbox series

blk-mq: remove unused code exist in blk_mq_dispatch_rq_list

Message ID 20200717092348.36303-1-yangerkun@huawei.com (mailing list archive)
State New, archived
Headers show
Series blk-mq: remove unused code exist in blk_mq_dispatch_rq_list | expand

Commit Message

yangerkun July 17, 2020, 9:23 a.m. UTC
Once .queue_rq return BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE, we will
insert the rq back to list, and will return false since '(!list_empty)'
always be true. The latter check seems unused.

Signed-off-by: yangerkun <yangerkun@huawei.com>
---
 block/blk-mq.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Ming Lei July 17, 2020, 10:03 a.m. UTC | #1
On Fri, Jul 17, 2020 at 05:23:48PM +0800, yangerkun wrote:
> Once .queue_rq return BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE, we will
> insert the rq back to list, and will return false since '(!list_empty)'
> always be true. The latter check seems unused.
> 
> Signed-off-by: yangerkun <yangerkun@huawei.com>
> ---
>  block/blk-mq.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 4e0d173beaa3..5e561283580f 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1361,13 +1361,6 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
>  	} else
>  		blk_mq_update_dispatch_busy(hctx, false);
>  
> -	/*
> -	 * If the host/device is unable to accept more work, inform the
> -	 * caller of that.
> -	 */
> -	if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
> -		return false;
> -
>  	return (queued + errors) != 0;
>  }
>  
> -- 
> 2.25.4
> 

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Jens Axboe July 17, 2020, 1:26 p.m. UTC | #2
On 7/17/20 3:23 AM, yangerkun wrote:
> Once .queue_rq return BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE, we will
> insert the rq back to list, and will return false since '(!list_empty)'
> always be true. The latter check seems unused.

This check is already gone in for-5.9/block
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4e0d173beaa3..5e561283580f 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1361,13 +1361,6 @@  bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
 	} else
 		blk_mq_update_dispatch_busy(hctx, false);
 
-	/*
-	 * If the host/device is unable to accept more work, inform the
-	 * caller of that.
-	 */
-	if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
-		return false;
-
 	return (queued + errors) != 0;
 }