]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - block/blk.h
blk-mq: fix updating tags depth
[mirror_ubuntu-bionic-kernel.git] / block / blk.h
index 85be8b232b373b3f69ac829f374e550f06725460..442098aa9463a37dad0dfccb1718eea65be6cdb3 100644 (file)
@@ -123,8 +123,15 @@ void blk_account_io_done(struct request *req);
  * Internal atomic flags for request handling
  */
 enum rq_atomic_flags {
+       /*
+        * Keep these two bits first - not because we depend on the
+        * value of them, but we do depend on them being in the same
+        * byte of storage to ensure ordering on writes. Keeping them
+        * first will achieve that nicely.
+        */
        REQ_ATOM_COMPLETE = 0,
        REQ_ATOM_STARTED,
+
        REQ_ATOM_POLL_SLEPT,
 };
 
@@ -149,45 +156,6 @@ static inline void blk_clear_rq_complete(struct request *rq)
 
 void blk_insert_flush(struct request *rq);
 
-static inline struct request *__elv_next_request(struct request_queue *q)
-{
-       struct request *rq;
-       struct blk_flush_queue *fq = blk_get_flush_queue(q, NULL);
-
-       WARN_ON_ONCE(q->mq_ops);
-
-       while (1) {
-               if (!list_empty(&q->queue_head)) {
-                       rq = list_entry_rq(q->queue_head.next);
-                       return rq;
-               }
-
-               /*
-                * Flush request is running and flush request isn't queueable
-                * in the drive, we can hold the queue till flush request is
-                * finished. Even we don't do this, driver can't dispatch next
-                * requests and will requeue them. And this can improve
-                * throughput too. For example, we have request flush1, write1,
-                * flush 2. flush1 is dispatched, then queue is hold, write1
-                * isn't inserted to queue. After flush1 is finished, flush2
-                * will be dispatched. Since disk cache is already clean,
-                * flush2 will be finished very soon, so looks like flush2 is
-                * folded to flush1.
-                * Since the queue is hold, a flag is set to indicate the queue
-                * should be restarted later. Please see flush_end_io() for
-                * details.
-                */
-               if (fq->flush_pending_idx != fq->flush_running_idx &&
-                               !queue_flush_queueable(q)) {
-                       fq->flush_queue_delayed = 1;
-                       return NULL;
-               }
-               if (unlikely(blk_queue_bypass(q)) ||
-                   !q->elevator->type->ops.sq.elevator_dispatch_fn(q, 0))
-                       return NULL;
-       }
-}
-
 static inline void elv_activate_rq(struct request_queue *q, struct request *rq)
 {
        struct elevator_queue *e = q->elevator;
@@ -362,4 +330,6 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio)
 }
 #endif /* CONFIG_BOUNCE */
 
+extern void blk_drain_queue(struct request_queue *q);
+
 #endif /* BLK_INTERNAL_H */