Commit e522c039 authored by Mike Snitzer's avatar Mike Snitzer

dm: cleanup dm_any_congested()

The request-based DM support for checking queue congestion doesn't
require access to the live DM table.
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent ae6ad75e
...@@ -2137,19 +2137,18 @@ static int dm_any_congested(void *congested_data, int bdi_bits) ...@@ -2137,19 +2137,18 @@ static int dm_any_congested(void *congested_data, int bdi_bits)
struct dm_table *map; struct dm_table *map;
if (!test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) { if (!test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) {
map = dm_get_live_table_fast(md); if (dm_request_based(md)) {
if (map) {
/* /*
* Request-based dm cares about only own queue for * With request-based DM we only need to check the
* the query about congestion status of request_queue * top-level queue for congestion.
*/ */
if (dm_request_based(md)) r = md->queue->backing_dev_info.wb.state & bdi_bits;
r = md->queue->backing_dev_info.wb.state & } else {
bdi_bits; map = dm_get_live_table_fast(md);
else if (map)
r = dm_table_any_congested(map, bdi_bits); r = dm_table_any_congested(map, bdi_bits);
dm_put_live_table_fast(md);
} }
dm_put_live_table_fast(md);
} }
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment