diff options
author | Mike Snitzer <snitzer@redhat.com> | 2020-09-19 20:09:11 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2020-09-29 23:33:07 +0300 |
commit | 33bd6f0693857492ab19869d79801437ac1e42ba (patch) | |
tree | 1ccd06964552349271e8a3b713ff190429ce588c /drivers/md/dm-table.c | |
parent | 7465d7ac50edb3158c5eb957c5ecd3a5310e1c68 (diff) | |
download | linux-33bd6f0693857492ab19869d79801437ac1e42ba.tar.xz |
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-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 704345e95cc1..3ad22adf322d 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -25,48 +25,10 @@ #define DM_MSG_PREFIX "table" -#define MAX_DEPTH 16 #define NODE_SIZE L1_CACHE_BYTES #define KEYS_PER_NODE (NODE_SIZE / sizeof(sector_t)) #define CHILDREN_PER_NODE (KEYS_PER_NODE + 1) -struct dm_table { - struct mapped_device *md; - enum dm_queue_mode type; - - /* btree table */ - unsigned int depth; - unsigned int counts[MAX_DEPTH]; /* in nodes */ - sector_t *index[MAX_DEPTH]; - - unsigned int num_targets; - unsigned int num_allocated; - sector_t *highs; - struct dm_target *targets; - - struct target_type *immutable_target_type; - - bool integrity_supported:1; - bool singleton:1; - unsigned integrity_added:1; - - /* - * Indicates the rw permissions for the new logical - * device. This should be a combination of FMODE_READ - * and FMODE_WRITE. - */ - fmode_t mode; - - /* a list of devices used by this table */ - struct list_head devices; - - /* events get handed up using this callback */ - void (*event_fn)(void *); - void *event_context; - - struct dm_md_mempools *mempools; -}; - /* * Similar to ceiling(log_size(n)) */ @@ -2085,16 +2047,11 @@ EXPORT_SYMBOL_GPL(dm_table_device_name); void dm_table_run_md_queue_async(struct dm_table *t) { - struct mapped_device *md; - struct request_queue *queue; - if (!dm_table_request_based(t)) return; - md = dm_table_get_md(t); - queue = dm_get_md_queue(md); - if (queue) - blk_mq_run_hw_queues(queue, true); + if (t->md->queue) + blk_mq_run_hw_queues(t->md->queue, true); } EXPORT_SYMBOL(dm_table_run_md_queue_async); |