Commit 0296e494 authored by Alasdair G. Kergon's avatar Alasdair G. Kergon Committed by Linus Torvalds

[PATCH] device-mapper: Export map_info

Export map_info (part of bio->bi_private) for targets like multipath to use
for storing context.
Signed-Off-By: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d6d16564
...@@ -43,6 +43,13 @@ struct target_io { ...@@ -43,6 +43,13 @@ struct target_io {
union map_info info; union map_info info;
}; };
union map_info *dm_get_mapinfo(struct bio *bio)
{
if (bio && bio->bi_private)
return &((struct target_io *)bio->bi_private)->info;
return NULL;
}
/* /*
* Bits for the md->flags field. * Bits for the md->flags field.
*/ */
...@@ -1172,6 +1179,8 @@ static struct block_device_operations dm_blk_dops = { ...@@ -1172,6 +1179,8 @@ static struct block_device_operations dm_blk_dops = {
.owner = THIS_MODULE .owner = THIS_MODULE
}; };
EXPORT_SYMBOL(dm_get_mapinfo);
/* /*
* module hooks * module hooks
*/ */
......
...@@ -190,5 +190,6 @@ int dm_stripe_init(void); ...@@ -190,5 +190,6 @@ int dm_stripe_init(void);
void dm_stripe_exit(void); void dm_stripe_exit(void);
void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
union map_info *dm_get_mapinfo(struct bio *bio);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment