Lines Matching refs:fq

95 			   struct blk_flush_queue *fq, blk_opf_t flags);
100 return blk_mq_map_queue(REQ_OP_FLUSH, ctx)->fq; in blk_get_flush_queue()
149 struct blk_flush_queue *fq, in blk_flush_complete_seq() argument
153 struct list_head *pending = &fq->flush_queue[fq->flush_pending_idx]; in blk_flush_complete_seq()
170 fq->flush_pending_since = jiffies; in blk_flush_complete_seq()
175 fq->flush_data_in_flight++; in blk_flush_complete_seq()
198 blk_kick_flush(q, fq, cmd_flags); in blk_flush_complete_seq()
208 struct blk_flush_queue *fq = blk_get_flush_queue(flush_rq->mq_ctx); in flush_end_io() local
211 spin_lock_irqsave(&fq->mq_flush_lock, flags); in flush_end_io()
214 fq->rq_status = error; in flush_end_io()
215 spin_unlock_irqrestore(&fq->mq_flush_lock, flags); in flush_end_io()
226 if (fq->rq_status != BLK_STS_OK) { in flush_end_io()
227 error = fq->rq_status; in flush_end_io()
228 fq->rq_status = BLK_STS_OK; in flush_end_io()
238 running = &fq->flush_queue[fq->flush_running_idx]; in flush_end_io()
239 BUG_ON(fq->flush_pending_idx == fq->flush_running_idx); in flush_end_io()
242 fq->flush_running_idx ^= 1; in flush_end_io()
250 blk_flush_complete_seq(rq, fq, seq, error); in flush_end_io()
253 spin_unlock_irqrestore(&fq->mq_flush_lock, flags); in flush_end_io()
275 static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq, in blk_kick_flush() argument
278 struct list_head *pending = &fq->flush_queue[fq->flush_pending_idx]; in blk_kick_flush()
281 struct request *flush_rq = fq->flush_rq; in blk_kick_flush()
284 if (fq->flush_pending_idx != fq->flush_running_idx || list_empty(pending)) in blk_kick_flush()
288 if (fq->flush_data_in_flight && in blk_kick_flush()
290 fq->flush_pending_since + FLUSH_PENDING_TIMEOUT)) in blk_kick_flush()
297 fq->flush_pending_idx ^= 1; in blk_kick_flush()
344 struct blk_flush_queue *fq = blk_get_flush_queue(ctx); in mq_flush_data_end_io() local
355 spin_lock_irqsave(&fq->mq_flush_lock, flags); in mq_flush_data_end_io()
356 fq->flush_data_in_flight--; in mq_flush_data_end_io()
362 blk_flush_complete_seq(rq, fq, REQ_FSEQ_DATA, error); in mq_flush_data_end_io()
363 spin_unlock_irqrestore(&fq->mq_flush_lock, flags); in mq_flush_data_end_io()
385 struct blk_flush_queue *fq = blk_get_flush_queue(rq->mq_ctx); in blk_insert_flush() local
444 spin_lock_irq(&fq->mq_flush_lock); in blk_insert_flush()
445 fq->flush_data_in_flight++; in blk_insert_flush()
446 spin_unlock_irq(&fq->mq_flush_lock); in blk_insert_flush()
454 spin_lock_irq(&fq->mq_flush_lock); in blk_insert_flush()
455 blk_flush_complete_seq(rq, fq, REQ_FSEQ_ACTIONS & ~policy, 0); in blk_insert_flush()
456 spin_unlock_irq(&fq->mq_flush_lock); in blk_insert_flush()
480 struct blk_flush_queue *fq; in blk_alloc_flush_queue() local
483 fq = kzalloc_node(sizeof(*fq), flags, node); in blk_alloc_flush_queue()
484 if (!fq) in blk_alloc_flush_queue()
487 spin_lock_init(&fq->mq_flush_lock); in blk_alloc_flush_queue()
490 fq->flush_rq = kzalloc_node(rq_sz, flags, node); in blk_alloc_flush_queue()
491 if (!fq->flush_rq) in blk_alloc_flush_queue()
494 INIT_LIST_HEAD(&fq->flush_queue[0]); in blk_alloc_flush_queue()
495 INIT_LIST_HEAD(&fq->flush_queue[1]); in blk_alloc_flush_queue()
497 return fq; in blk_alloc_flush_queue()
500 kfree(fq); in blk_alloc_flush_queue()
505 void blk_free_flush_queue(struct blk_flush_queue *fq) in blk_free_flush_queue() argument
508 if (!fq) in blk_free_flush_queue()
511 kfree(fq->flush_rq); in blk_free_flush_queue()
512 kfree(fq); in blk_free_flush_queue()
536 lockdep_set_class(&hctx->fq->mq_flush_lock, key); in blk_mq_hctx_set_fq_lock_class()