Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/2] block: remove the write_hint field from struct request
Date: Tue, 12 Nov 2024 10:29:35 -0800	[thread overview]
Message-ID: <aa3b1983-d166-451f-899f-74d6f75687ed@acm.org> (raw)
In-Reply-To: <20241112170050.1612998-2-hch@lst.de>

On 11/12/24 9:00 AM, Christoph Hellwig wrote:
> -	/* Don't merge requests with different write hints. */
> -	if (req->write_hint != next->write_hint)
> -		return NULL;
> +	if (req->bio && next->bio) {
> +		/* Don't merge requests with different write hints. */
> +		if (req->bio->bi_write_hint != next->bio->bi_write_hint)
> +			return NULL;
> +	}

The above two if-statements can be combined into a single if-statement.

> @@ -1001,9 +1003,11 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
>   	if (!bio_crypt_rq_ctx_compatible(rq, bio))
>   		return false;
>   
> -	/* Don't merge requests with different write hints. */
> -	if (rq->write_hint != bio->bi_write_hint)
> -		return false;
> +	if (rq->bio) {
> +		/* Don't merge requests with different write hints. */
> +		if (rq->bio->bi_write_hint != bio->bi_write_hint)
> +			return false;
> +	}

Same comment here: the above two if-statements can also be combined into 
a single if-statement.

Otherwise this patch looks good to me.

Thanks,

Bart.

  reply	other threads:[~2024-11-12 18:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20241112183746epcas5p40dcbbbd42a0f0be597193bf0808f8e67@epcas5p4.samsung.com>
2024-11-12 17:00 ` remove two fields from struct request Christoph Hellwig
2024-11-12 17:00   ` [PATCH 1/2] block: remove the write_hint field " Christoph Hellwig
2024-11-12 18:29     ` Bart Van Assche [this message]
2024-11-12 18:32       ` Bart Van Assche
2024-11-12 17:00   ` [PATCH 2/2] block: remove the ioprio " Christoph Hellwig
2024-11-12 18:22     ` John Garry
2024-11-13  5:06       ` Christoph Hellwig
2024-11-12 18:32     ` Bart Van Assche
2024-11-22  5:04     ` Sam Protsenko
2024-11-22 12:04       ` Christoph Hellwig
2024-11-22 21:55         ` Sam Protsenko
2024-11-22 22:18           ` Bart Van Assche
2024-11-25 23:13             ` Sam Protsenko
2024-11-25  7:36           ` Christoph Hellwig
2024-11-26  1:37             ` Sam Protsenko
2024-11-26  6:52               ` Christoph Hellwig
2024-11-26  7:37                 ` Sam Protsenko
2024-11-12 18:29   ` remove two fields " Nitesh Shetty
2024-11-12 21:43   ` 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=aa3b1983-d166-451f-899f-74d6f75687ed@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@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