Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: simplify ioc_lookup_icq

Remove the ioc argument as it always points to current->io_context.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211126115817.2087431-15-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
eca5892a 18b74c4d

+6 -6
+1 -1
block/bfq-iosched.c
··· 444 444 return NULL; 445 445 446 446 spin_lock_irqsave(&q->queue_lock, flags); 447 - icq = icq_to_bic(ioc_lookup_icq(current->io_context, q)); 447 + icq = icq_to_bic(ioc_lookup_icq(q)); 448 448 spin_unlock_irqrestore(&q->queue_lock, flags); 449 449 450 450 return icq;
+4 -4
block/blk-ioc.c
··· 353 353 354 354 /** 355 355 * ioc_lookup_icq - lookup io_cq from ioc 356 - * @ioc: the associated io_context 357 356 * @q: the associated request_queue 358 357 * 359 358 * Look up io_cq associated with @ioc - @q pair from @ioc. Must be called 360 359 * with @q->queue_lock held. 361 360 */ 362 - struct io_cq *ioc_lookup_icq(struct io_context *ioc, struct request_queue *q) 361 + struct io_cq *ioc_lookup_icq(struct request_queue *q) 363 362 { 363 + struct io_context *ioc = current->io_context; 364 364 struct io_cq *icq; 365 365 366 366 lockdep_assert_held(&q->queue_lock); ··· 430 430 et->ops.init_icq(icq); 431 431 } else { 432 432 kmem_cache_free(et->icq_cache, icq); 433 - icq = ioc_lookup_icq(ioc, q); 433 + icq = ioc_lookup_icq(q); 434 434 if (!icq) 435 435 printk(KERN_ERR "cfq: icq link failed!\n"); 436 436 } ··· 454 454 get_io_context(ioc); 455 455 456 456 spin_lock_irq(&q->queue_lock); 457 - icq = ioc_lookup_icq(ioc, q); 457 + icq = ioc_lookup_icq(q); 458 458 spin_unlock_irq(&q->queue_lock); 459 459 } 460 460
+1 -1
block/blk.h
··· 364 364 * Internal io_context interface 365 365 */ 366 366 struct io_cq *ioc_find_get_icq(struct request_queue *q); 367 - struct io_cq *ioc_lookup_icq(struct io_context *ioc, struct request_queue *q); 367 + struct io_cq *ioc_lookup_icq(struct request_queue *q); 368 368 void ioc_clear_queue(struct request_queue *q); 369 369 370 370 #ifdef CONFIG_BLK_DEV_THROTTLING_LOW