Skip to contentSkip to conversation

block: cleanup for blk_cleanup_queue()

PATCH In review Shenghui Wang 2 participants 2 messages Apr 7, 2019 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: cleanup for blk_cleanup_queue()

2 small cleanup:
* blk_set_queue_dying(q) has set QUEUE_FLAG_DYING. Remove the redundant statement 'blk_queue_flag_set(QUEUE_FLAG_DYING, q)'
* requests queued drained before DEAD marking, not DYING marking. Update the comment.

---
 block/blk-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
block/blk-core.c +1 -2
index 4673ebe42255..177377becfab 100644
@@ -334,11 +334,10 @@ void blk_cleanup_queue(struct request_queue *q)
 
 	blk_queue_flag_set(QUEUE_FLAG_NOMERGES, q);
 	blk_queue_flag_set(QUEUE_FLAG_NOXMERGES, q);
-	blk_queue_flag_set(QUEUE_FLAG_DYING, q);
 	mutex_unlock(&q->sysfs_lock);
 
 	/*
-	 * Drain all requests queued before DYING marking. Set DEAD flag to
+	 * Drain all requests queued before DEAD marking. Set DEAD flag to
 	 * prevent that q->request_fn() gets invoked after draining finished.
 	 */
 	blk_freeze_queue(q);
Signature · 1 line
2.20.1
#1 lore raw

block/blk-core.c void blk_cleanup_queue(struct request_queue *q) · line 342

Quoted 5 lines · Shenghui Wang

/*

block/blk-core.c +1 -1
-	 * Drain all requests queued before DYING marking. Set DEAD flag to
+	 * Drain all requests queued before DEAD marking. Set DEAD flag to
  	 * prevent that q->request_fn() gets invoked after draining finished.
  	 */

No new requests can be queued between the "dying" and "dead" states. I wrote "dying" in that comment because I meant "dying". See also commit 3f3299d5c026 ("block: Rename queue dead flag").

Bart.