From: Boaz Harrosh <bharrosh@panasas.com>
To: Jeff Garzik <jeff@garzik.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Jens Axboe <jens.axboe@oracle.com>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
linux-scs
Subject: [RFC B 1/2] Export new blk_make_request() which takes bio and returns request
Date: Thu, 19 Mar 2009 16:30:17 +0200 [thread overview]
Message-ID: <49C256F9.5000800@panasas.com> (raw)
In-Reply-To: <49C254FD.7020202@panasas.com>
given a struct bio allocates a new request. This is the parallel of
generic_make_request for BLOCK_PC commands users.
The new API is:
+struct request *blk_make_request(struct request_queue *q, struct bio *bio,
+ gfp_t gfp_mask);
This is in the effort of un-exporting blk_rq_append_bio()
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
block/blk-core.c | 13 +++++++++++++
include/linux/blkdev.h | 5 ++++-
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 9ee243e..7136c11 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -903,6 +903,19 @@ struct request *blk_get_request(struct request_queue *q, int rw, gfp_t gfp_mask)
}
EXPORT_SYMBOL(blk_get_request);
+struct request *blk_make_request(struct request_queue *q, struct bio *bio,
+ gfp_t gfp_mask)
+{
+ struct request *rq = blk_get_request(q, bio_data_dir(bio), gfp_mask);
+
+ if (rq) {
+ blk_rq_bio_prep(q, rq, bio);
+ blk_queue_bounce(q, &rq->bio);
+ }
+ return rq;
+}
+EXPORT_SYMBOL(blk_make_request);
+
/**
* blk_start_queueing - initiate dispatch of requests to device
* @q: request queue to kick into gear
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 465d6ba..22dcdde 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -729,6 +729,8 @@ extern void blk_rq_init(struct request_queue *q, struct request *rq);
extern void blk_put_request(struct request *);
extern void __blk_put_request(struct request_queue *, struct request *);
extern struct request *blk_get_request(struct request_queue *, int, gfp_t);
+extern struct request *blk_make_request(struct request_queue *, struct bio *,
+ gfp_t);
extern void blk_insert_request(struct request_queue *, struct request *, int, void *);
extern void blk_requeue_request(struct request_queue *, struct request *);
extern int blk_rq_check_limits(struct request_queue *q, struct request *rq);
next prev parent reply other threads:[~2009-03-19 14:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-19 14:21 [RFD] [PATCHSETS 0/2 0/2 0/5] Remove of blk_rq_append_bio usage Boaz Harrosh
2009-03-19 14:24 ` [PATCH A 1/2] allow blk_rq_map_kern to append to requests Boaz Harrosh
2009-03-19 14:27 ` [PATCH A 2/2] libosd: Use new blk_rq_map_kern Boaz Harrosh
2009-03-19 14:30 ` Boaz Harrosh [this message]
2009-03-19 14:31 ` [RFC B 2/2] libosd: Use of new blk_make_request Boaz Harrosh
2009-03-19 14:33 ` [RFC C 1/5] blk_rq_map_pages() new API Boaz Harrosh
2009-03-19 14:34 ` [RFC C 2/5] libosd: Rename osd_req_write/read to osd_req_write/read_old Boaz Harrosh
2009-03-19 14:35 ` [RFC C 3/5] libosd: No bio for you Boaz Harrosh
2009-03-19 14:37 ` [RFC C 4/5] exofs: " Boaz Harrosh
2009-03-19 14:38 ` [RFC C 5/5] libosd: Remove deprecated bio based API Boaz Harrosh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49C256F9.5000800@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=jeff@garzik.org \
--cc=jens.axboe@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.