From: Mike Anderson <[email-masked]>

Add a dm_table accessor function to check if md is being deleted.

Signed-off-by: Mike Anderson <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>

---
 drivers/md/dm-table.c         |    6 ++++++
 include/linux/device-mapper.h |    5 +++++
 2 files changed, 11 insertions(+)

Index: linux-2.6.32-rc6/drivers/md/dm-table.c
===================================================================
--- linux-2.6.32-rc6.orig/drivers/md/dm-table.c
+++ linux-2.6.32-rc6/drivers/md/dm-table.c
@@ -1245,6 +1245,12 @@ struct mapped_device *dm_table_get_md(st
 	return t->md;
 }
 
+int dm_table_deleting_md(struct dm_table *t)
+{
+	return dm_deleting_md(t->md);
+}
+EXPORT_SYMBOL(dm_table_deleting_md);
+
 EXPORT_SYMBOL(dm_vcalloc);
 EXPORT_SYMBOL(dm_get_device);
 EXPORT_SYMBOL(dm_put_device);
Index: linux-2.6.32-rc6/include/linux/device-mapper.h
===================================================================
--- linux-2.6.32-rc6.orig/include/linux/device-mapper.h
+++ linux-2.6.32-rc6/include/linux/device-mapper.h
@@ -290,6 +290,11 @@ fmode_t dm_table_get_mode(struct dm_tabl
 struct mapped_device *dm_table_get_md(struct dm_table *t);
 
 /*
+ * Is the device that owns this table in the process of being deleted?
+ */
+int dm_table_deleting_md(struct dm_table *t);
+
+/*
  * Trigger an event.
  */
 void dm_table_event(struct dm_table *t);