aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2018-11-06 22:35:00 +0100
committerMike Snitzer <snitzer@redhat.com>2018-11-12 11:53:04 -0500
commitb5616f7a11592cc74860f4ec3e3c4fba6688eefa (patch)
treebefb798550c9e1f084f46d599b0ea1d2f99a0c8d
parent5592a9e56e33e2154baff09c19e1c0282d83fb0a (diff)
downloadlinux-dm-b5616f7a11592cc74860f4ec3e3c4fba6688eefa.tar.gz
dm: dont rewrite dm_disk(md)->part0.in_flight
Notice: this object is not reachable from any branch.
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>
Notice: this object is not reachable from any branch.
-rw-r--r--drivers/md/dm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index e591dd57fa180..5f02ffa265f6d 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -663,8 +663,7 @@ static void start_io_acct(struct dm_io *io)
generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio),
&dm_disk(md)->part0);
- atomic_set(&dm_disk(md)->part0.in_flight[rw],
- atomic_inc_return(&md->pending[rw]));
+ atomic_inc(&md->pending[rw]);
if (unlikely(dm_stats_used(&md->stats)))
dm_stats_account_io(&md->stats, bio_data_dir(bio),
@@ -693,7 +692,6 @@ static void end_io_acct(struct dm_io *io)
* a flush.
*/
pending = atomic_dec_return(&md->pending[rw]);
- atomic_set(&dm_disk(md)->part0.in_flight[rw], pending);
pending += atomic_read(&md->pending[rw^0x1]);
/* nudge anyone waiting on suspend queue */