diff options
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 9558a4acec12..84f4594afd3c 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #define CHILDREN_PER_NODE (KEYS_PER_NODE + 1) | 22 | #define CHILDREN_PER_NODE (KEYS_PER_NODE + 1) |
23 | 23 | ||
24 | struct dm_table { | 24 | struct dm_table { |
25 | struct mapped_device *md; | ||
25 | atomic_t holders; | 26 | atomic_t holders; |
26 | 27 | ||
27 | /* btree table */ | 28 | /* btree table */ |
@@ -206,7 +207,8 @@ static int alloc_targets(struct dm_table *t, unsigned int num) | |||
206 | return 0; | 207 | return 0; |
207 | } | 208 | } |
208 | 209 | ||
209 | int dm_table_create(struct dm_table **result, int mode, unsigned num_targets) | 210 | int dm_table_create(struct dm_table **result, int mode, |
211 | unsigned num_targets, struct mapped_device *md) | ||
210 | { | 212 | { |
211 | struct dm_table *t = kmalloc(sizeof(*t), GFP_KERNEL); | 213 | struct dm_table *t = kmalloc(sizeof(*t), GFP_KERNEL); |
212 | 214 | ||
@@ -229,6 +231,7 @@ int dm_table_create(struct dm_table **result, int mode, unsigned num_targets) | |||
229 | } | 231 | } |
230 | 232 | ||
231 | t->mode = mode; | 233 | t->mode = mode; |
234 | t->md = md; | ||
232 | *result = t; | 235 | *result = t; |
233 | return 0; | 236 | return 0; |
234 | } | 237 | } |
@@ -952,12 +955,20 @@ int dm_table_flush_all(struct dm_table *t) | |||
952 | return ret; | 955 | return ret; |
953 | } | 956 | } |
954 | 957 | ||
958 | struct mapped_device *dm_table_get_md(struct dm_table *t) | ||
959 | { | ||
960 | dm_get(t->md); | ||
961 | |||
962 | return t->md; | ||
963 | } | ||
964 | |||
955 | EXPORT_SYMBOL(dm_vcalloc); | 965 | EXPORT_SYMBOL(dm_vcalloc); |
956 | EXPORT_SYMBOL(dm_get_device); | 966 | EXPORT_SYMBOL(dm_get_device); |
957 | EXPORT_SYMBOL(dm_put_device); | 967 | EXPORT_SYMBOL(dm_put_device); |
958 | EXPORT_SYMBOL(dm_table_event); | 968 | EXPORT_SYMBOL(dm_table_event); |
959 | EXPORT_SYMBOL(dm_table_get_size); | 969 | EXPORT_SYMBOL(dm_table_get_size); |
960 | EXPORT_SYMBOL(dm_table_get_mode); | 970 | EXPORT_SYMBOL(dm_table_get_mode); |
971 | EXPORT_SYMBOL(dm_table_get_md); | ||
961 | EXPORT_SYMBOL(dm_table_put); | 972 | EXPORT_SYMBOL(dm_table_put); |
962 | EXPORT_SYMBOL(dm_table_get); | 973 | EXPORT_SYMBOL(dm_table_get); |
963 | EXPORT_SYMBOL(dm_table_unplug_all); | 974 | EXPORT_SYMBOL(dm_table_unplug_all); |