public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: tj@kernel.org, James.Bottomley@HansenPartnership.com,
	bharrosh@panasas.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] block: let blk_end_request_all handle bidi requests
Date: Mon, 11 May 2009 11:06:30 +0200	[thread overview]
Message-ID: <20090511090629.GO4694@kernel.dk> (raw)
In-Reply-To: <1242032169-22422-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>

On Mon, May 11 2009, FUJITA Tomonori wrote:
> blk_end_request_all() and __blk_end_request_all() should finish all
> bytes including bidi, by definition. That's what all bidi users need ,
> bidi requests must be complete as a whole (partial completion is
> impossible).
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  include/linux/blkdev.h |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 8919683..3b5c564 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -911,8 +911,12 @@ static inline bool blk_end_request(struct request *rq, int error,
>  static inline void blk_end_request_all(struct request *rq, int error)
>  {
>  	bool pending;
> +	unsigned int bidi_bytes = 0;
>  
> -	pending = blk_end_request(rq, error, blk_rq_bytes(rq));
> +	if (unlikely(blk_bidi_rq(rq)))
> +		bidi_bytes = blk_rq_bytes(rq->next_rq);
> +
> +	pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
>  	BUG_ON(pending);
>  }
>  
> @@ -963,8 +967,12 @@ static inline bool __blk_end_request(struct request *rq, int error,
>  static inline void __blk_end_request_all(struct request *rq, int error)
>  {
>  	bool pending;
> +	unsigned int bidi_bytes = 0;
> +
> +	if (unlikely(blk_bidi_rq(rq)))
> +		bidi_bytes = blk_rq_bytes(rq->next_rq);
>  
> -	pending = __blk_end_request(rq, error, blk_rq_bytes(rq));
> +	pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
>  	BUG_ON(pending);
>  }

Looks ok, perhaps we can next get rid of the bidi naming? It's all
pretty much folded into one anyway, using __blk_end_bidi_request() from
generic end-request handling looks confusing.

-- 
Jens Axboe


  reply	other threads:[~2009-05-11  9:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11  8:56 [PATCH 0/3] block: completion releated functions cleanup FUJITA Tomonori
2009-05-11  8:56 ` [PATCH 1/3] block: let blk_end_request_all handle bidi requests FUJITA Tomonori
2009-05-11  9:06   ` Jens Axboe [this message]
2009-05-11  9:11     ` FUJITA Tomonori
2009-05-11  9:16       ` Jens Axboe
2009-05-11  8:56 ` [PATCH 2/3] scsi: simplify the bidi completion FUJITA Tomonori
2009-05-11  8:56 ` [PATCH 3/3] block: move completion related functions back to blk-core.c FUJITA Tomonori
2009-05-11  9:06 ` [PATCH 0/3] block: completion releated functions cleanup Jens Axboe
2009-05-14 13:54 ` [PATCH 0/3] block: completion related " Boaz Harrosh
2009-05-14 14:05   ` Tejun Heo
2009-05-14 14:15     ` Boaz Harrosh
2009-05-14 15:46       ` Tejun Heo
2009-05-15  0:12       ` FUJITA Tomonori

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=20090511090629.GO4694@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bharrosh@panasas.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tj@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