Skip to content

Commit 61c9c45

Browse files
bvanasschekawasaki
authored andcommitted
blk-zoned: Split an if-statement
Split an if-statement and also the comment above that if-statement. This patch prepares for moving code from disk_zone_wplug_add_bio() into its caller. No functionality has been changed. Cc: Damien Le Moal <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Bart Van Assche <[email protected]>
1 parent 346384d commit 61c9c45

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

block/blk-zoned.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,13 +1036,14 @@ static bool blk_zone_wplug_handle_write(struct bio *bio, unsigned int nr_segs)
10361036
bio_set_flag(bio, BIO_ZONE_WRITE_PLUGGING);
10371037

10381038
/*
1039-
* If the zone is already plugged, add the BIO to the plug BIO list.
1040-
* Do the same for REQ_NOWAIT BIOs to ensure that we will not see a
1039+
* Add REQ_NOWAIT BIOs to the plug list to ensure that we will not see a
10411040
* BLK_STS_AGAIN failure if we let the BIO execute.
1042-
* Otherwise, plug and let the BIO execute.
10431041
*/
1044-
if ((zwplug->flags & BLK_ZONE_WPLUG_PLUGGED) ||
1045-
(bio->bi_opf & REQ_NOWAIT))
1042+
if (bio->bi_opf & REQ_NOWAIT)
1043+
goto plug;
1044+
1045+
/* If the zone is already plugged, add the BIO to the plug BIO list. */
1046+
if (zwplug->flags & BLK_ZONE_WPLUG_PLUGGED)
10461047
goto plug;
10471048

10481049
if (!blk_zone_wplug_prepare_bio(zwplug, bio)) {
@@ -1051,6 +1052,7 @@ static bool blk_zone_wplug_handle_write(struct bio *bio, unsigned int nr_segs)
10511052
return true;
10521053
}
10531054

1055+
/* Otherwise, plug and submit the BIO. */
10541056
zwplug->flags |= BLK_ZONE_WPLUG_PLUGGED;
10551057

10561058
spin_unlock_irqrestore(&zwplug->lock, flags);

0 commit comments

Comments
 (0)