Re: [PATCH 1/2] block: remove the write_hint field from struct request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/12/24 10:29 AM, Bart Van Assche wrote:
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.

(replying to my own email)

Since apparently the goal is to minimize diffs in the next patch,

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux