bfq: simplify bfq_bic_lookup
Remove the unused bfqd argument, and hardcode ioc to current->io_context. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20211126115817.2087431-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
88c9a2ce52
commit
836b394b63
@@ -433,26 +433,21 @@ static struct bfq_io_cq *icq_to_bic(struct io_cq *icq)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* bfq_bic_lookup - search into @ioc a bic associated to @bfqd.
|
* bfq_bic_lookup - search into @ioc a bic associated to @bfqd.
|
||||||
* @bfqd: the lookup key.
|
|
||||||
* @ioc: the io_context of the process doing I/O.
|
|
||||||
* @q: the request queue.
|
* @q: the request queue.
|
||||||
*/
|
*/
|
||||||
static struct bfq_io_cq *bfq_bic_lookup(struct bfq_data *bfqd,
|
static struct bfq_io_cq *bfq_bic_lookup(struct request_queue *q)
|
||||||
struct io_context *ioc,
|
|
||||||
struct request_queue *q)
|
|
||||||
{
|
{
|
||||||
if (ioc) {
|
struct bfq_io_cq *icq;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct bfq_io_cq *icq;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&q->queue_lock, flags);
|
if (!current->io_context)
|
||||||
icq = icq_to_bic(ioc_lookup_icq(ioc, q));
|
return NULL;
|
||||||
spin_unlock_irqrestore(&q->queue_lock, flags);
|
|
||||||
|
|
||||||
return icq;
|
spin_lock_irqsave(&q->queue_lock, flags);
|
||||||
}
|
icq = icq_to_bic(ioc_lookup_icq(current->io_context, q));
|
||||||
|
spin_unlock_irqrestore(&q->queue_lock, flags);
|
||||||
|
|
||||||
return NULL;
|
return icq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2457,7 +2452,7 @@ static bool bfq_bio_merge(struct request_queue *q, struct bio *bio,
|
|||||||
* returned by bfq_bic_lookup does not go away before
|
* returned by bfq_bic_lookup does not go away before
|
||||||
* bfqd->lock is taken.
|
* bfqd->lock is taken.
|
||||||
*/
|
*/
|
||||||
struct bfq_io_cq *bic = bfq_bic_lookup(bfqd, current->io_context, q);
|
struct bfq_io_cq *bic = bfq_bic_lookup(q);
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
spin_lock_irq(&bfqd->lock);
|
spin_lock_irq(&bfqd->lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user