summaryrefslogtreecommitdiff
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2020-09-19 13:09:11 -0400
committerMike Snitzer <snitzer@redhat.com>2020-09-29 16:33:07 -0400
commit33bd6f0693857492ab19869d79801437ac1e42ba (patch)
tree1ccd06964552349271e8a3b713ff190429ce588c /drivers/md/dm.c
parent7465d7ac50edb3158c5eb957c5ecd3a5310e1c68 (diff)
downloadlwn-33bd6f0693857492ab19869d79801437ac1e42ba.tar.gz
lwn-33bd6f0693857492ab19869d79801437ac1e42ba.zip
dm table: make 'struct dm_table' definition accessible to all of DM core
Move 'struct dm_table' definition from dm-table.c to dm-core.h and update DM core to access its members directly. Helps optimize max_io_len() and other methods slightly. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index b5b18bafd865..a1adcf0ab821 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -422,21 +422,6 @@ static void do_deferred_remove(struct work_struct *w)
dm_deferred_remove();
}
-sector_t dm_get_size(struct mapped_device *md)
-{
- return get_capacity(md->disk);
-}
-
-struct request_queue *dm_get_md_queue(struct mapped_device *md)
-{
- return md->queue;
-}
-
-struct dm_stats *dm_get_stats(struct mapped_device *md)
-{
- return &md->stats;
-}
-
static int dm_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
{
struct mapped_device *md = bdev->bd_disk->private_data;
@@ -1057,7 +1042,7 @@ static sector_t max_io_len(struct dm_target *ti, sector_t sector)
* blk_max_size_offset() provides required splitting.
* - blk_max_size_offset() also respects q->limits.max_sectors
*/
- max_len = blk_max_size_offset(dm_table_get_md(ti->table)->queue,
+ max_len = blk_max_size_offset(ti->table->md->queue,
target_offset);
if (len > max_len)
len = max_len;
@@ -2931,19 +2916,19 @@ int dm_test_deferred_remove_flag(struct mapped_device *md)
int dm_suspended(struct dm_target *ti)
{
- return dm_suspended_md(dm_table_get_md(ti->table));
+ return dm_suspended_md(ti->table->md);
}
EXPORT_SYMBOL_GPL(dm_suspended);
int dm_post_suspending(struct dm_target *ti)
{
- return dm_post_suspending_md(dm_table_get_md(ti->table));
+ return dm_post_suspending_md(ti->table->md);
}
EXPORT_SYMBOL_GPL(dm_post_suspending);
int dm_noflush_suspending(struct dm_target *ti)
{
- return __noflush_suspending(dm_table_get_md(ti->table));
+ return __noflush_suspending(ti->table->md);
}
EXPORT_SYMBOL_GPL(dm_noflush_suspending);