diff options
author | Mike Snitzer <snitzer@kernel.org> | 2022-07-05 20:00:36 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-07-07 17:49:33 +0200 |
commit | 2aec377a29250b942f14d3c16d49783da3e9df11 (patch) | |
tree | 6deeee9da1656b677617f7de3ef954e2f2d257cf /drivers/md/dm-ioctl.c | |
parent | dm: add two stage requeue mechanism (diff) | |
download | linux-2aec377a29250b942f14d3c16d49783da3e9df11.tar.xz linux-2aec377a29250b942f14d3c16d49783da3e9df11.zip |
dm table: remove dm_table_get_num_targets() wrapper
More efficient and readable to just access table->num_targets directly.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 87310fceb0d8..98976aaa9db9 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -832,7 +832,7 @@ static void __dev_status(struct mapped_device *md, struct dm_ioctl *param) if (!(param->flags & DM_QUERY_INACTIVE_TABLE_FLAG)) { if (get_disk_ro(disk)) param->flags |= DM_READONLY_FLAG; - param->target_count = dm_table_get_num_targets(table); + param->target_count = table->num_targets; } param->flags |= DM_ACTIVE_PRESENT_FLAG; @@ -845,7 +845,7 @@ static void __dev_status(struct mapped_device *md, struct dm_ioctl *param) if (table) { if (!(dm_table_get_mode(table) & FMODE_WRITE)) param->flags |= DM_READONLY_FLAG; - param->target_count = dm_table_get_num_targets(table); + param->target_count = table->num_targets; } dm_put_live_table(md, srcu_idx); } @@ -1248,7 +1248,7 @@ static void retrieve_status(struct dm_table *table, type = STATUSTYPE_INFO; /* Get all the target info */ - num_targets = dm_table_get_num_targets(table); + num_targets = table->num_targets; for (i = 0; i < num_targets; i++) { struct dm_target *ti = dm_table_get_target(table, i); size_t l; |