2 * BFQ: I/O context handling.
4 * Based on ideas and code from CFQ:
5 * Copyright (C) 2003 Jens Axboe <axboe@kernel.dk>
7 * Copyright (C) 2008 Fabio Checconi <fabio@gandalf.sssup.it>
8 * Paolo Valente <paolo.valente@unimore.it>
12 * icq_to_bic - convert iocontext queue structure to bfq_io_cq.
13 * @icq: the iocontext queue.
15 static inline struct bfq_io_cq
*icq_to_bic(struct io_cq
*icq
)
17 /* bic->icq is the first member, %NULL will convert to %NULL */
18 return container_of(icq
, struct bfq_io_cq
, icq
);
22 * bfq_bic_lookup - search into @ioc a bic associated to @bfqd.
23 * @bfqd: the lookup key.
24 * @ioc: the io_context of the process doing I/O.
26 * Queue lock must be held.
28 static inline struct bfq_io_cq
*bfq_bic_lookup(struct bfq_data
*bfqd
,
29 struct io_context
*ioc
)
32 return icq_to_bic(ioc_lookup_icq(ioc
, bfqd
->queue
));