Skip to content

Commit e6791e9

Browse files
bvanasschekawasaki
authored andcommitted
blk-zoned: Split an if-statement
Prepare for moving code from disk_zone_wplug_add_bio() into its caller. Split an if-statement and also the comment above that if-statement. No functionality has been changed. Signed-off-by: Bart Van Assche <[email protected]>
1 parent 9bd505e commit e6791e9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

block/blk-zoned.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,14 +1029,14 @@ static bool blk_zone_wplug_handle_write(struct bio *bio, unsigned int nr_segs)
10291029
/* Indicate that this BIO is being handled using zone write plugging. */
10301030
bio_set_flag(bio, BIO_ZONE_WRITE_PLUGGING);
10311031

1032+
/* If the zone is already plugged, add the BIO to the plug BIO list. */
1033+
if (zwplug->flags & BLK_ZONE_WPLUG_PLUGGED)
1034+
goto plug;
10321035
/*
1033-
* If the zone is already plugged, add the BIO to the plug BIO list.
10341036
* Do the same for REQ_NOWAIT BIOs to ensure that we will not see a
10351037
* BLK_STS_AGAIN failure if we let the BIO execute.
1036-
* Otherwise, plug and let the BIO execute.
10371038
*/
1038-
if ((zwplug->flags & BLK_ZONE_WPLUG_PLUGGED) ||
1039-
(bio->bi_opf & REQ_NOWAIT))
1039+
if (bio->bi_opf & REQ_NOWAIT)
10401040
goto plug;
10411041

10421042
if (!blk_zone_wplug_prepare_bio(zwplug, bio)) {
@@ -1045,6 +1045,7 @@ static bool blk_zone_wplug_handle_write(struct bio *bio, unsigned int nr_segs)
10451045
return true;
10461046
}
10471047

1048+
/* Otherwise, plug and submit the BIO. */
10481049
zwplug->flags |= BLK_ZONE_WPLUG_PLUGGED;
10491050

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

0 commit comments

Comments
 (0)