Lines Matching refs:fq

97 			   struct blk_flush_queue *fq, unsigned int flags);
165 struct blk_flush_queue *fq, in blk_flush_complete_seq() argument
169 struct list_head *pending = &fq->flush_queue[fq->flush_pending_idx]; in blk_flush_complete_seq()
186 fq->flush_pending_since = jiffies; in blk_flush_complete_seq()
191 list_move_tail(&rq->flush.list, &fq->flush_data_in_flight); in blk_flush_complete_seq()
212 blk_kick_flush(q, fq, cmd_flags); in blk_flush_complete_seq()
221 struct blk_flush_queue *fq = blk_get_flush_queue(q, flush_rq->mq_ctx); in flush_end_io() local
226 spin_lock_irqsave(&fq->mq_flush_lock, flags); in flush_end_io()
229 fq->rq_status = error; in flush_end_io()
230 spin_unlock_irqrestore(&fq->mq_flush_lock, flags); in flush_end_io()
240 if (fq->rq_status != BLK_STS_OK) in flush_end_io()
241 error = fq->rq_status; in flush_end_io()
250 running = &fq->flush_queue[fq->flush_running_idx]; in flush_end_io()
251 BUG_ON(fq->flush_pending_idx == fq->flush_running_idx); in flush_end_io()
254 fq->flush_running_idx ^= 1; in flush_end_io()
261 blk_flush_complete_seq(rq, fq, seq, error); in flush_end_io()
264 spin_unlock_irqrestore(&fq->mq_flush_lock, flags); in flush_end_io()
280 static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq, in blk_kick_flush() argument
283 struct list_head *pending = &fq->flush_queue[fq->flush_pending_idx]; in blk_kick_flush()
286 struct request *flush_rq = fq->flush_rq; in blk_kick_flush()
289 if (fq->flush_pending_idx != fq->flush_running_idx || list_empty(pending)) in blk_kick_flush()
293 if (!list_empty(&fq->flush_data_in_flight) && in blk_kick_flush()
295 fq->flush_pending_since + FLUSH_PENDING_TIMEOUT)) in blk_kick_flush()
302 fq->flush_pending_idx ^= 1; in blk_kick_flush()
344 struct blk_flush_queue *fq = blk_get_flush_queue(q, ctx); in mq_flush_data_end_io() local
355 spin_lock_irqsave(&fq->mq_flush_lock, flags); in mq_flush_data_end_io()
356 blk_flush_complete_seq(rq, fq, REQ_FSEQ_DATA, error); in mq_flush_data_end_io()
357 spin_unlock_irqrestore(&fq->mq_flush_lock, flags); in mq_flush_data_end_io()
376 struct blk_flush_queue *fq = blk_get_flush_queue(q, rq->mq_ctx); in blk_insert_flush() local
428 spin_lock_irq(&fq->mq_flush_lock); in blk_insert_flush()
429 blk_flush_complete_seq(rq, fq, REQ_FSEQ_ACTIONS & ~policy, 0); in blk_insert_flush()
430 spin_unlock_irq(&fq->mq_flush_lock); in blk_insert_flush()
459 struct blk_flush_queue *fq; in blk_alloc_flush_queue() local
462 fq = kzalloc_node(sizeof(*fq), flags, node); in blk_alloc_flush_queue()
463 if (!fq) in blk_alloc_flush_queue()
466 spin_lock_init(&fq->mq_flush_lock); in blk_alloc_flush_queue()
469 fq->flush_rq = kzalloc_node(rq_sz, flags, node); in blk_alloc_flush_queue()
470 if (!fq->flush_rq) in blk_alloc_flush_queue()
473 INIT_LIST_HEAD(&fq->flush_queue[0]); in blk_alloc_flush_queue()
474 INIT_LIST_HEAD(&fq->flush_queue[1]); in blk_alloc_flush_queue()
475 INIT_LIST_HEAD(&fq->flush_data_in_flight); in blk_alloc_flush_queue()
477 lockdep_register_key(&fq->key); in blk_alloc_flush_queue()
478 lockdep_set_class(&fq->mq_flush_lock, &fq->key); in blk_alloc_flush_queue()
480 return fq; in blk_alloc_flush_queue()
483 kfree(fq); in blk_alloc_flush_queue()
488 void blk_free_flush_queue(struct blk_flush_queue *fq) in blk_free_flush_queue() argument
491 if (!fq) in blk_free_flush_queue()
494 lockdep_unregister_key(&fq->key); in blk_free_flush_queue()
495 kfree(fq->flush_rq); in blk_free_flush_queue()
496 kfree(fq); in blk_free_flush_queue()