Skip to content

Commit 80a787b

Browse files
Mikulas Patockaaxboe
authored andcommitted
dm: dont rewrite dm_disk(md)->part0.in_flight
generic_start_io_acct and generic_end_io_acct already update the variable in_flight using atomic operations, so we don't have to overwrite them again. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 96f7741 commit 80a787b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/md/dm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,7 @@ static void start_io_acct(struct dm_io *io)
663663
generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio),
664664
&dm_disk(md)->part0);
665665

666-
atomic_set(&dm_disk(md)->part0.in_flight[rw],
667-
atomic_inc_return(&md->pending[rw]));
666+
atomic_inc(&md->pending[rw]);
668667

669668
if (unlikely(dm_stats_used(&md->stats)))
670669
dm_stats_account_io(&md->stats, bio_data_dir(bio),
@@ -693,7 +692,6 @@ static void end_io_acct(struct dm_io *io)
693692
* a flush.
694693
*/
695694
pending = atomic_dec_return(&md->pending[rw]);
696-
atomic_set(&dm_disk(md)->part0.in_flight[rw], pending);
697695
pending += atomic_read(&md->pending[rw^0x1]);
698696

699697
/* nudge anyone waiting on suspend queue */

0 commit comments

Comments
 (0)