Skip to content

Commit 548d88f

Browse files
damien-lemoalMikulas Patocka
authored andcommitted
dm: Simplify dm_io_complete()
The local variable first_requeue is not needed since it is always equal to dm_io_flagged(io, DM_IO_WAS_SPLIT). Call __dm_io_complete() passing this value directly and remove first_requeue. Also declare dm_io_complete() as inline to make sure it is inlined in its single call site, thus avoiding the cost of a function call. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent d142643 commit 548d88f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/md/dm.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,10 +1024,8 @@ static void dm_wq_requeue_work(struct work_struct *work)
10241024
*
10251025
* 2) io->orig_bio points to new cloned bio which matches the requeued dm_io.
10261026
*/
1027-
static void dm_io_complete(struct dm_io *io)
1027+
static inline void dm_io_complete(struct dm_io *io)
10281028
{
1029-
bool first_requeue;
1030-
10311029
/*
10321030
* Only dm_io that has been split needs two stage requeue, otherwise
10331031
* we may run into long bio clone chain during suspend and OOM could
@@ -1036,12 +1034,7 @@ static void dm_io_complete(struct dm_io *io)
10361034
* Also flush data dm_io won't be marked as DM_IO_WAS_SPLIT, so they
10371035
* also aren't handled via the first stage requeue.
10381036
*/
1039-
if (dm_io_flagged(io, DM_IO_WAS_SPLIT))
1040-
first_requeue = true;
1041-
else
1042-
first_requeue = false;
1043-
1044-
__dm_io_complete(io, first_requeue);
1037+
__dm_io_complete(io, dm_io_flagged(io, DM_IO_WAS_SPLIT));
10451038
}
10461039

10471040
/*

0 commit comments

Comments
 (0)