Skip to content

Commit 2d6de57

Browse files
bvanasschekawasaki
authored andcommitted
blk-zoned: Split blk_zone_wplug_bio_work()
Prepare for submitting multiple bios from inside a single blk_zone_wplug_bio_work() call. No functionality has been changed. Signed-off-by: Bart Van Assche <[email protected]>
1 parent 7651a21 commit 2d6de57

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

block/blk-zoned.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,10 +1257,8 @@ void blk_zone_write_plug_finish_request(struct request *req)
12571257
disk_put_zone_wplug(zwplug);
12581258
}
12591259

1260-
static void blk_zone_wplug_bio_work(struct work_struct *work)
1260+
static void blk_zone_submit_one_bio(struct blk_zone_wplug *zwplug)
12611261
{
1262-
struct blk_zone_wplug *zwplug =
1263-
container_of(work, struct blk_zone_wplug, bio_work);
12641262
struct block_device *bdev;
12651263
unsigned long flags;
12661264
struct bio *bio;
@@ -1276,7 +1274,7 @@ static void blk_zone_wplug_bio_work(struct work_struct *work)
12761274
if (!bio) {
12771275
zwplug->flags &= ~BLK_ZONE_WPLUG_PLUGGED;
12781276
spin_unlock_irqrestore(&zwplug->lock, flags);
1279-
goto put_zwplug;
1277+
return;
12801278
}
12811279

12821280
if (!blk_zone_wplug_prepare_bio(zwplug, bio)) {
@@ -1300,8 +1298,15 @@ static void blk_zone_wplug_bio_work(struct work_struct *work)
13001298
} else {
13011299
blk_mq_submit_bio(bio);
13021300
}
1301+
}
1302+
1303+
static void blk_zone_wplug_bio_work(struct work_struct *work)
1304+
{
1305+
struct blk_zone_wplug *zwplug =
1306+
container_of(work, struct blk_zone_wplug, bio_work);
1307+
1308+
blk_zone_submit_one_bio(zwplug);
13031309

1304-
put_zwplug:
13051310
/* Drop the reference we took in disk_zone_wplug_schedule_bio_work(). */
13061311
disk_put_zone_wplug(zwplug);
13071312
}

0 commit comments

Comments
 (0)