Skip to contentSkip to conversation

blk-mq: remove unused code exist in blk_mq_dispatch_rq_list

PATCH In review yangerkun 3 participants 3 messages Jul 17, 2020 Block layer

lore
Share & tools
lore

yangerkun

author
#0 lore raw

PATCH 1/1 blk-mq: remove unused code exist in blk_mq_dispatch_rq_list

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.

---
 block/blk-mq.c | 7 -------
 1 file changed, 7 deletions(-)
block/blk-mq.c +0 -7
index 4e0d173beaa3..5e561283580f 100644
@@ -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;
 }
 
Signature · 1 line
2.25.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · yangerkun

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.

---
 block/blk-mq.c | 7 -------
 1 file changed, 7 deletions(-)
block/blk-mq.c +0 -7
index 4e0d173beaa3..5e561283580f 100644
@@ -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;
 }
 
Signature · 1 line
2.25.4
Signature · 1 line
Ming
maintainer
#2 lore raw
In reply to yangerkun
Quoted 3 lines · yangerkun

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

Signature · 1 line
Jens Axboe