OSDN Git Service

block: move blk_steal_bios to blk-mq.c
authorChristoph Hellwig <hch@lst.de>
Wed, 17 Nov 2021 06:14:00 +0000 (07:14 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 29 Nov 2021 13:34:51 +0000 (06:34 -0700)
Keep all the request based code together.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20211117061404.331732-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-mq.c

index 6c0bc2d..65891f0 100644 (file)
@@ -1167,27 +1167,6 @@ void disk_end_io_acct(struct gendisk *disk, unsigned int op,
 }
 EXPORT_SYMBOL(disk_end_io_acct);
 
-/*
- * Steal bios from a request and add them to a bio list.
- * The request must not have been partially completed before.
- */
-void blk_steal_bios(struct bio_list *list, struct request *rq)
-{
-       if (rq->bio) {
-               if (list->tail)
-                       list->tail->bi_next = rq->bio;
-               else
-                       list->head = rq->bio;
-               list->tail = rq->biotail;
-
-               rq->bio = NULL;
-               rq->biotail = NULL;
-       }
-
-       rq->__data_len = 0;
-}
-EXPORT_SYMBOL_GPL(blk_steal_bios);
-
 /**
  * blk_lld_busy - Check if underlying low-level drivers of a device are busy
  * @q : the queue of the device being checked
index 3217139..cd5f31c 100644 (file)
@@ -3014,6 +3014,27 @@ free_and_out:
 }
 EXPORT_SYMBOL_GPL(blk_rq_prep_clone);
 
+/*
+ * Steal bios from a request and add them to a bio list.
+ * The request must not have been partially completed before.
+ */
+void blk_steal_bios(struct bio_list *list, struct request *rq)
+{
+       if (rq->bio) {
+               if (list->tail)
+                       list->tail->bi_next = rq->bio;
+               else
+                       list->head = rq->bio;
+               list->tail = rq->biotail;
+
+               rq->bio = NULL;
+               rq->biotail = NULL;
+       }
+
+       rq->__data_len = 0;
+}
+EXPORT_SYMBOL_GPL(blk_steal_bios);
+
 static size_t order_to_size(unsigned int order)
 {
        return (size_t)PAGE_SIZE << order;