
From: Alasdair G Kergon <agk@redhat.com>

Export map_info (part of bio->bi_private) for targets like multipath to use
for storing context.

Signed-Off-By: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/md/dm.c |    9 +++++++++
 25-akpm/drivers/md/dm.h |    1 +
 2 files changed, 10 insertions(+)

diff -puN drivers/md/dm.c~device-mapper-export-map_info drivers/md/dm.c
--- 25/drivers/md/dm.c~device-mapper-export-map_info	2005-02-22 18:19:24.000000000 -0800
+++ 25-akpm/drivers/md/dm.c	2005-02-22 18:19:24.000000000 -0800
@@ -43,6 +43,13 @@ struct target_io {
 	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.
  */
@@ -1172,6 +1179,8 @@ static struct block_device_operations dm
 	.owner = THIS_MODULE
 };
 
+EXPORT_SYMBOL(dm_get_mapinfo);
+
 /*
  * module hooks
  */
diff -puN drivers/md/dm.h~device-mapper-export-map_info drivers/md/dm.h
--- 25/drivers/md/dm.h~device-mapper-export-map_info	2005-02-22 18:19:24.000000000 -0800
+++ 25-akpm/drivers/md/dm.h	2005-02-22 18:19:24.000000000 -0800
@@ -190,5 +190,6 @@ int dm_stripe_init(void);
 void dm_stripe_exit(void);
 
 void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
+union map_info *dm_get_mapinfo(struct bio *bio);
 
 #endif
_
