소스 검색

block: move initialization of elevator-related fields to blk_alloc_queue_node

No point in doing this in elevator_init.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Tested-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Christoph Hellwig 7 년 전
부모
커밋
cbf62af353
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 0
      block/blk-core.c
  2. 0 5
      block/elevator.c

+ 5 - 0
block/blk-core.c

@@ -999,6 +999,11 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id,
 	if (!q)
 	if (!q)
 		return NULL;
 		return NULL;
 
 
+	INIT_LIST_HEAD(&q->queue_head);
+	q->last_merge = NULL;
+	q->end_sector = 0;
+	q->boundary_rq = NULL;
+
 	q->id = ida_simple_get(&blk_queue_ida, 0, 0, gfp_mask);
 	q->id = ida_simple_get(&blk_queue_ida, 0, 0, gfp_mask);
 	if (q->id < 0)
 	if (q->id < 0)
 		goto fail_q;
 		goto fail_q;

+ 0 - 5
block/elevator.c

@@ -213,11 +213,6 @@ int elevator_init(struct request_queue *q, char *name)
 	if (unlikely(q->elevator))
 	if (unlikely(q->elevator))
 		return 0;
 		return 0;
 
 
-	INIT_LIST_HEAD(&q->queue_head);
-	q->last_merge = NULL;
-	q->end_sector = 0;
-	q->boundary_rq = NULL;
-
 	if (name) {
 	if (name) {
 		e = elevator_get(q, name, true);
 		e = elevator_get(q, name, true);
 		if (!e)
 		if (!e)