Skip to contentSkip to conversation

block/mq-deadline: Remove the redundant rb_entry_rq in the deadline_from_pos().

PATCH Superseded chengkaitao 3 participants 3 messages Aug 29, 2025 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block/mq-deadline: Remove the redundant rb_entry_rq in the deadline_from_pos().

From: chengkaitao <[email protected]>

In commit(fde02699c242), the "if (blk_rq_is_seq_zoned_write(rq))" was removed, but the "rb_entry_rq(node)" and some other code were inadvertently left behind. This patch fixed it.

---
 block/mq-deadline.c | 4 ----
 1 file changed, 4 deletions(-)
block/mq-deadline.c +0 -4
index 1a031922c447..63145cc9825f 100644
@@ -133,10 +133,6 @@ static inline struct request *deadline_from_pos(struct dd_per_prio *per_prio,
 	struct rb_node *node = per_prio->sort_list[data_dir].rb_node;
 	struct request *rq, *res = NULL;
 
-	if (!node)
-		return NULL;
-
-	rq = rb_entry_rq(node);
 	while (node) {
 		rq = rb_entry_rq(node);
 		if (blk_rq_pos(rq) >= pos) {
Signature · 1 line
2.39.5 (Apple Git-154)
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · chengkaitao

In commit(fde02699c242), the "if (blk_rq_is_seq_zoned_write(rq))" was removed, but the "rb_entry_rq(node)" and some other code were inadvertently left behind. This patch fixed it.

Reviewed-by on v2 1/1
#2 lore raw
In reply to chengkaitao
Quoted 16 lines · chengkaitao

From: chengkaitao <[email protected]>

In commit(fde02699c242), the "if (blk_rq_is_seq_zoned_write(rq))" was removed, but the "rb_entry_rq(node)" and some other code were inadvertently left behind. This patch fixed it.

---
  block/mq-deadline.c | 4 ----
  1 file changed, 4 deletions(-)
block/mq-deadline.c +0 -0
index 1a031922c447..63145cc9825f 100644

block/mq-deadline.c static inline struct request *deadline_from_pos(struct dd_per_prio *per_prio, · line 138

Quoted 10 lines
block/mq-deadline.c +0 -4
@@ -133,10 +133,6 @@ static inline struct request *deadline_from_pos(struct dd_per_prio *per_prio,
  	struct rb_node *node = per_prio->sort_list[data_dir].rb_node;
  	struct request *rq, *res = NULL;
 
-	if (!node)
-		return NULL;
-
-	rq = rb_entry_rq(node);
  	while (node) {
  		rq = rb_entry_rq(node);
  		if (blk_rq_pos(rq) >= pos) {

LGTM

Signature · 2 lines
Thanks,
Nan