[RPC PATCH 1/5] block: expose init_request_from_bio

From: Matias BjÃrling
Date: Tue Nov 18 2014 - 14:45:23 EST


When doing internal commands within LightNVM, we may form it as a bio.
It can then use the existing infrastructure for handling bio's.
Expose init_request_from_bio as blk_init_request_from_bio and allow
requests to initialized from bio's.

Signed-off-by: Matias BjÃrling <m@xxxxxxxxxxx>
---
block/blk-core.c | 6 ++++++
include/linux/blkdev.h | 1 +
2 files changed, 7 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index bf930f4..53f9488 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1546,6 +1546,12 @@ void init_request_from_bio(struct request *req, struct bio *bio)
blk_rq_bio_prep(req->q, req, bio);
}

+void blk_init_request_from_bio(struct request *req, struct bio *bio)
+{
+ init_request_from_bio(req, bio);
+}
+EXPORT_SYMBOL(blk_init_request_from_bio);
+
void blk_queue_bio(struct request_queue *q, struct bio *bio)
{
const bool sync = !!(bio->bi_rw & REQ_SYNC);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 518b465..75296c0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -823,6 +823,7 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
struct scsi_ioctl_command __user *);

extern void blk_queue_bio(struct request_queue *q, struct bio *bio);
+extern void blk_init_request_from_bio(struct request *req, struct bio *bio);

/*
* A queue has just exitted congestion. Note this in the global counter of
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/