All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Christoph Hellwig <hch@lst.de>, "axboe@kernel.dk" <axboe@kernel.dk>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: tidy up blk_mq_plug
Date: Thu, 11 Jul 2019 18:08:13 +0000	[thread overview]
Message-ID: <BYAPR04MB57490CAC59A77556A820D0A186F30@BYAPR04MB5749.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20190711111714.4802-1-hch@lst.de

Looks good, we should avoid "!" conditions when possible it
makes code much easier to read.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 07/11/2019 04:17 AM, Christoph Hellwig wrote:
> Make the zoned device write path the special case and just fall
> though to the defaul case to make the code easier to read.  Also
> update the top of function comment to use the proper kdoc format
> and remove the extra in-function comments that just duplicate it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>   block/blk-mq.h | 14 ++++----------
>   1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/block/blk-mq.h b/block/blk-mq.h
> index 32c62c64e6c2..ab80fd2b3803 100644
> --- a/block/blk-mq.h
> +++ b/block/blk-mq.h
> @@ -233,7 +233,7 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap)
>   		qmap->mq_map[cpu] = 0;
>   }
>
> -/*
> +/**
>    * blk_mq_plug() - Get caller context plug
>    * @q: request queue
>    * @bio : the bio being submitted by the caller context
> @@ -254,15 +254,9 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap)
>   static inline struct blk_plug *blk_mq_plug(struct request_queue *q,
>   					   struct bio *bio)
>   {
> -	/*
> -	 * For regular block devices or read operations, use the context plug
> -	 * which may be NULL if blk_start_plug() was not executed.
> -	 */
> -	if (!blk_queue_is_zoned(q) || !op_is_write(bio_op(bio)))
> -		return current->plug;
> -
> -	/* Zoned block device write operation case: do not plug the BIO */
> -	return NULL;
> +	if (blk_queue_is_zoned(q) && op_is_write(bio_op(bio)))
> +		return NULL;
> +	return current->plug;
>   }
>
>   #endif
>


  reply	other threads:[~2019-07-11 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 11:17 [PATCH] block: tidy up blk_mq_plug Christoph Hellwig
2019-07-11 18:08 ` Chaitanya Kulkarni [this message]
2019-07-11 18:09 ` Jens Axboe
2019-07-12  2:37   ` Damien Le Moal
2019-07-12  2:44     ` Jens Axboe
2019-07-12  2:50       ` Damien Le Moal

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=BYAPR04MB57490CAC59A77556A820D0A186F30@BYAPR04MB5749.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@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 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.