public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <htejun@gmail.com>
Subject: [PATCH 005 of 6] Stop exporting blk_rq_bio_prep
Date: Thu, 16 Aug 2007 21:21:21 +1000	[thread overview]
Message-ID: <1070816112121.12230@suse.de> (raw)
In-Reply-To: 20070816211551.11839.patches@notabene


blk_rq_bio_prep is exported for use in exactly
one place.  That place can benefit from using
the new blk_rq_append_bio instead. 
So
  - change dm-emc to call blk_rq_append_bio
  - stop exporting blk_rq_bio_prep, and
  - initialise rq_disk in blk_rq_bio_prep,
       as dm-emc needs it.

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./block/ll_rw_blk.c      |   11 +++++++----
 ./drivers/md/dm-emc.c    |   10 +---------
 ./include/linux/blkdev.h |    1 -
 3 files changed, 8 insertions(+), 14 deletions(-)

diff .prev/block/ll_rw_blk.c ./block/ll_rw_blk.c
--- .prev/block/ll_rw_blk.c	2007-08-16 21:10:16.000000000 +1000
+++ ./block/ll_rw_blk.c	2007-08-16 21:10:55.000000000 +1000
@@ -43,6 +43,8 @@ static void init_request_from_bio(struct
 static int __make_request(struct request_queue *q, struct bio *bio);
 static struct io_context *current_io_context(gfp_t gfp_flags, int node);
 static void blk_recalc_rq_segments(struct request *rq);
+static void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
+			    struct bio *bio);
 
 /*
  * For the allocated request tables
@@ -3652,8 +3654,8 @@ void end_request(struct request *req, in
 
 EXPORT_SYMBOL(end_request);
 
-void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
-		     struct bio *bio)
+static void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
+			    struct bio *bio)
 {
 	/* first two bits are identical in rq->cmd_flags and bio->bi_rw */
 	rq->cmd_flags |= (bio->bi_rw & 3);
@@ -3667,9 +3669,10 @@ void blk_rq_bio_prep(struct request_queu
 	rq->data_len = bio->bi_size;
 
 	rq->bio = rq->biotail = bio;
-}
 
-EXPORT_SYMBOL(blk_rq_bio_prep);
+	if (bio->bi_bdev)
+		rq->rq_disk = bio->bi_bdev->bd_disk;
+}
 
 int kblockd_schedule_work(struct work_struct *work)
 {

diff .prev/drivers/md/dm-emc.c ./drivers/md/dm-emc.c
--- .prev/drivers/md/dm-emc.c	2007-08-16 17:37:43.000000000 +1000
+++ ./drivers/md/dm-emc.c	2007-08-16 21:10:30.000000000 +1000
@@ -109,15 +109,7 @@ static struct request *get_failover_req(
 		return NULL;
 	}
 
-	rq->bio = rq->biotail = bio;
-	blk_rq_bio_prep(q, rq, bio);
-
-	rq->rq_disk = bdev->bd_contains->bd_disk;
-
-	/* bio backed don't set data */
-	rq->buffer = rq->data = NULL;
-	/* rq data_len used for pc cmd's request_bufflen */
-	rq->data_len = bio->bi_size;
+	blk_rq_append_bio(q, rq, bio);
 
 	rq->sense = h->sense;
 	memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE);

diff .prev/include/linux/blkdev.h ./include/linux/blkdev.h
--- .prev/include/linux/blkdev.h	2007-08-16 21:10:16.000000000 +1000
+++ ./include/linux/blkdev.h	2007-08-16 21:10:30.000000000 +1000
@@ -823,7 +823,6 @@ static inline struct request *blk_map_qu
 	return bqt->tag_index[tag];
 }
 
-extern void blk_rq_bio_prep(struct request_queue *, struct request *, struct bio *);
 extern int blkdev_issue_flush(struct block_device *, sector_t *);
 
 #define MAX_PHYS_SEGMENTS 128

  parent reply	other threads:[~2007-08-16 11:23 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-16 11:20 [PATCH 000 of 6] A few block-layer tidy-up patches NeilBrown
2007-08-16 11:20 ` [PATCH 001 of 6] Merge blk_recount_segments into blk_recalc_rq_segments NeilBrown
2007-08-16 11:21 ` [PATCH 002 of 6] Introduce rq_for_each_segment replacing rq_for_each_bio NeilBrown
2007-08-17  7:13   ` Geert Uytterhoeven
2007-08-18 14:37     ` Satyam Sharma
2007-08-18 14:30       ` Jan Engelhardt
2007-08-18 14:48         ` Satyam Sharma
2007-08-20 11:21           ` Geert Uytterhoeven
2007-08-20 12:46             ` Jan Engelhardt
2007-08-21  1:38             ` Satyam Sharma
2007-08-21  7:09               ` Geert Uytterhoeven
2007-08-21  9:46                 ` Satyam Sharma
2007-08-21  9:52                   ` Geert Uytterhoeven
2007-08-21 10:41                     ` [PATCH] PS3: Update MAINTAINERS Satyam Sharma
2007-08-21 19:01                       ` Geoff Levand
2007-08-21 20:01                         ` Joe Perches
2007-08-21 20:06                           ` Rene Herman
2007-08-21 20:17                             ` Geoff Levand
2007-08-21 20:33                               ` Rene Herman
2007-08-21 20:48                               ` Satyam Sharma
2007-08-21 20:41                                 ` Rene Herman
2007-08-21 20:47                                 ` Joe Perches
2007-08-21 21:58                         ` Hugh Blemings
2007-08-23 18:14                           ` Matt Mackall
2007-08-24  5:52                             ` Hugh Blemings
2007-08-21 20:10                       ` Geoff Levand
2007-08-24  6:25                       ` [Cbe-oss-dev] " Hugh Blemings
2007-08-24  6:47                         ` Satyam Sharma
2007-08-24  6:48                           ` Hugh Blemings
2007-08-16 11:21 ` [PATCH 003 of 6] Fix various abuse of bio fields in umem.c NeilBrown
2007-08-16 11:21 ` [PATCH 004 of 6] New function blk_req_append_bio NeilBrown
2007-08-16 11:21 ` NeilBrown [this message]
2007-08-16 11:21 ` [PATCH 006 of 6] Share code between init_request_from_bio and blk_rq_bio_prep NeilBrown
2007-08-16 11:36 ` [PATCH 000 of 6] A few block-layer tidy-up patches Jens Axboe
2007-08-17  0:40   ` Neil Brown
2007-08-17  6:17     ` Jens Axboe
2007-08-17  7:21       ` Neil Brown
2007-08-17 12:37         ` Jens Axboe

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=1070816112121.12230@suse.de \
    --to=neilb@suse.de \
    --cc=htejun@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox