|
@@ -2769,6 +2769,27 @@ struct request *blk_fetch_request(struct request_queue *q)
|
|
|
}
|
|
|
EXPORT_SYMBOL(blk_fetch_request);
|
|
|
|
|
|
+/*
|
|
|
+ * 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_update_request - Special helper function for request stacking drivers
|
|
|
* @req: the request being processed
|