linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Jens Axboe <jens.axboe@oracle.com>
Cc: linux-scsi@vger.kernel.org, bzolnier@gmail.com,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH 3/6] block: rename and export rq_init()
Date: Sun, 27 Apr 2008 14:41:09 +0300	[thread overview]
Message-ID: <48146655.2050806@panasas.com> (raw)
In-Reply-To: <1209140607-28654-4-git-send-email-fujita.tomonori@lab.ntt.co.jp>

On Fri, Apr 25 2008 at 19:23 +0300, FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> This rename rq_init() blk_rq_init() and export it. Any path that hands
> the request to the block layer needs to call it to initialize the
> request.
> 
> This is a preparation for large command support, which needs to
> initialize the request in a proper way (that is, just doing a memset()
> will not work).
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Cc: Jens Axboe <jens.axboe@oracle.com>

Please, if not to late, add:
Cc: Boaz Harrosh <bharrosh@panasas.com>

> ---
>  block/blk-barrier.c    |    4 ++--
>  block/blk-core.c       |    5 +++--
>  block/blk.h            |    1 -
>  include/linux/blkdev.h |    1 +
>  4 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/block/blk-barrier.c b/block/blk-barrier.c
> index 722140a..5e2cfe9 100644
> --- a/block/blk-barrier.c
> +++ b/block/blk-barrier.c
> @@ -143,7 +143,7 @@ static void queue_flush(struct request_queue *q, unsigned which)
>  		end_io = post_flush_end_io;
>  	}
>  
> -	rq_init(q, rq);
> +	blk_rq_init(q, rq);
>  	rq->cmd_flags = REQ_HARDBARRIER;
>  	rq->rq_disk = q->bar_rq.rq_disk;
>  	rq->end_io = end_io;
> @@ -165,7 +165,7 @@ static inline struct request *start_ordered(struct request_queue *q,
>  	blkdev_dequeue_request(rq);
>  	q->orig_bar_rq = rq;
>  	rq = &q->bar_rq;
> -	rq_init(q, rq);
> +	blk_rq_init(q, rq);
>  	if (bio_data_dir(q->orig_bar_rq->bio) == WRITE)
>  		rq->cmd_flags |= REQ_RW;
>  	if (q->ordered & QUEUE_ORDERED_FUA)
> diff --git a/block/blk-core.c b/block/blk-core.c
> index e7cdabc..a89adcc 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -107,7 +107,7 @@ struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev)
>  }
>  EXPORT_SYMBOL(blk_get_backing_dev_info);
>  
> -void rq_init(struct request_queue *q, struct request *rq)
> +void blk_rq_init(struct request_queue *q, struct request *rq)
>  {
>  	memset(rq, 0, sizeof(*rq));
>  
> @@ -120,6 +120,7 @@ void rq_init(struct request_queue *q, struct request *rq)
>  	rq->tag = -1;
>  	rq->ref_count = 1;
>  }
> +EXPORT_SYMBOL(blk_rq_init);
>  
>  static void req_bio_endio(struct request *rq, struct bio *bio,
>  			  unsigned int nbytes, int error)
> @@ -601,7 +602,7 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask)
>  	if (!rq)
>  		return NULL;
>  
> -	rq_init(q, rq);
> +	blk_rq_init(q, rq);
>  
>  	/*
>  	 * first three bits are identical in rq->cmd_flags and bio->bi_rw,
> diff --git a/block/blk.h b/block/blk.h
> index ec9120f..59776ab 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -10,7 +10,6 @@
>  extern struct kmem_cache *blk_requestq_cachep;
>  extern struct kobj_type blk_queue_ktype;
>  
> -void rq_init(struct request_queue *q, struct request *rq);
>  void init_request_from_bio(struct request *req, struct bio *bio);
>  void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
>  			struct bio *bio);
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 8ca481c..d17032c 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -607,6 +607,7 @@ extern int blk_register_queue(struct gendisk *disk);
>  extern void blk_unregister_queue(struct gendisk *disk);
>  extern void register_disk(struct gendisk *dev);
>  extern void generic_make_request(struct bio *bio);
> +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 void blk_end_sync_rq(struct request *rq, int error);


  parent reply	other threads:[~2008-04-27 11:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-25 16:23 [PATCH 0/6] add large command support to the block layer FUJITA Tomonori
2008-04-25 16:40 ` [PATCH 1/6] block: no need to initialize rq->cmd in prepare_flush_fn hook FUJITA Tomonori
2008-04-25 16:23   ` [PATCH 2/6] block: no need to initialize rq->cmd with blk_get_request FUJITA Tomonori
2008-04-25 16:23     ` [PATCH 3/6] block: rename and export rq_init() FUJITA Tomonori
2008-04-25 16:23       ` [PATCH 4/6] block: use blk_rq_init() to initialize the request FUJITA Tomonori
2008-04-25 16:23         ` [PATCH 5/6] ide: " FUJITA Tomonori
2008-04-25 16:23           ` [PATCH 6/6] block: add large command support FUJITA Tomonori
2008-04-27 11:43             ` Boaz Harrosh
2008-04-27 11:42           ` [PATCH 5/6] ide: use blk_rq_init() to initialize the request Boaz Harrosh
2008-04-27 11:41         ` [PATCH 4/6] block: " Boaz Harrosh
2008-04-27 11:41       ` Boaz Harrosh [this message]
2008-04-25 16:45     ` [dm-devel] [PATCH 2/6] block: no need to initialize rq->cmd with blk_get_request James Bottomley
2008-04-25 16:54       ` FUJITA Tomonori
2008-04-25 16:59         ` James Bottomley
2008-04-25 18:35           ` FUJITA Tomonori
2008-04-29  7:54 ` [PATCH 0/6] add large command support to the block layer Jens Axboe
2008-04-29 11:55   ` Bartlomiej Zolnierkiewicz
2008-04-29 12:32     ` FUJITA Tomonori
2008-04-29 12:37       ` Jens Axboe
2008-04-29 12:45         ` FUJITA Tomonori
2008-04-29 12:46           ` 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=48146655.2050806@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=bzolnier@gmail.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jens.axboe@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).