Lines Matching full:plug
606 /* If plug is not used, add new plug here to cache nsecs time. */ in __submit_bio()
607 struct blk_plug plug; in __submit_bio() local
612 blk_start_plug(&plug); in __submit_bio()
623 blk_finish_plug(&plug); in __submit_bio()
927 blk_flush_plug(current->plug, false); in bio_poll()
1098 void blk_start_plug_nr_ios(struct blk_plug *plug, unsigned short nr_ios) in blk_start_plug_nr_ios() argument
1103 * If this is a nested plug, don't actually assign it. in blk_start_plug_nr_ios()
1105 if (tsk->plug) in blk_start_plug_nr_ios()
1108 plug->cur_ktime = 0; in blk_start_plug_nr_ios()
1109 plug->mq_list = NULL; in blk_start_plug_nr_ios()
1110 plug->cached_rq = NULL; in blk_start_plug_nr_ios()
1111 plug->nr_ios = min_t(unsigned short, nr_ios, BLK_MAX_REQUEST_COUNT); in blk_start_plug_nr_ios()
1112 plug->rq_count = 0; in blk_start_plug_nr_ios()
1113 plug->multiple_queues = false; in blk_start_plug_nr_ios()
1114 plug->has_elevator = false; in blk_start_plug_nr_ios()
1115 INIT_LIST_HEAD(&plug->cb_list); in blk_start_plug_nr_ios()
1121 tsk->plug = plug; in blk_start_plug_nr_ios()
1126 * @plug: The &struct blk_plug that needs to be initialized
1144 * plug. By flushing the pending I/O when the process goes to sleep, we avoid
1147 void blk_start_plug(struct blk_plug *plug) in blk_start_plug() argument
1149 blk_start_plug_nr_ios(plug, 1); in blk_start_plug()
1153 static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule) in flush_plug_callbacks() argument
1157 while (!list_empty(&plug->cb_list)) { in flush_plug_callbacks()
1158 list_splice_init(&plug->cb_list, &callbacks); in flush_plug_callbacks()
1173 struct blk_plug *plug = current->plug; in blk_check_plugged() local
1176 if (!plug) in blk_check_plugged()
1179 list_for_each_entry(cb, &plug->cb_list, list) in blk_check_plugged()
1189 list_add(&cb->list, &plug->cb_list); in blk_check_plugged()
1195 void __blk_flush_plug(struct blk_plug *plug, bool from_schedule) in __blk_flush_plug() argument
1197 if (!list_empty(&plug->cb_list)) in __blk_flush_plug()
1198 flush_plug_callbacks(plug, from_schedule); in __blk_flush_plug()
1199 blk_mq_flush_plug_list(plug, from_schedule); in __blk_flush_plug()
1206 if (unlikely(!rq_list_empty(plug->cached_rq))) in __blk_flush_plug()
1207 blk_mq_free_plug_rqs(plug); in __blk_flush_plug()
1209 plug->cur_ktime = 0; in __blk_flush_plug()
1215 * @plug: The &struct blk_plug passed to blk_start_plug()
1223 void blk_finish_plug(struct blk_plug *plug) in blk_finish_plug() argument
1225 if (plug == current->plug) { in blk_finish_plug()
1226 __blk_flush_plug(plug, false); in blk_finish_plug()
1227 current->plug = NULL; in blk_finish_plug()