dm: move dm_table to dm-core.h
Mikulas Patocka
maintainerPATCH 3/4 dm: move dm_table to dm-core.h
Move the definition of struct dm_table from dm-table.c to dm-core.h - so, that it can be used by dm.c.
Signed-off-by Mikulas Patocka <[email protected]>
--- drivers/md/dm-core.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ drivers/md/dm-table.c | 44 -------------------------------------------- 2 files changed, 45 insertions(+), 44 deletions(-)
drivers/md/dm-core.h +45 -0
@@ -115,6 +115,51 @@ struct mapped_device {struct srcu_struct io_barrier; }; +#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; + +struct list_head target_callbacks; +}; + +void disable_write_same (struct mapped_device *md);void disable_write_zeroes (struct mapped_device *md);
drivers/md/dm-table.c +0 -44
50 lines not on this page · raw message