From: Mikulas Patocka <[email-masked]>

Change #include "dm.h" to #include <linux/device-mapper.h> in all targets.
Targets should not need direct access to internal DM structures.

Signed-off-by: Mikulas Patocka <[email-masked]>
Signed-off-by: Alasdair G Kergon <[email-masked]>

---
 drivers/md/dm-crypt.c           |    2 +-
 drivers/md/dm-delay.c           |    3 ++-
 drivers/md/dm-exception-store.c |    1 -
 drivers/md/dm-io.c              |    2 +-
 drivers/md/dm-kcopyd.c          |    1 +
 drivers/md/dm-linear.c          |    2 +-
 drivers/md/dm-log.c             |    2 +-
 drivers/md/dm-mpath.c           |    3 ++-
 drivers/md/dm-path-selector.c   |    3 ++-
 drivers/md/dm-raid1.c           |    3 ++-
 drivers/md/dm-round-robin.c     |    3 ++-
 drivers/md/dm-snap.h            |    2 +-
 drivers/md/dm-stripe.c          |    2 +-
 drivers/md/dm-zero.c            |    2 +-
 14 files changed, 18 insertions(+), 13 deletions(-)

Index: linux-2.6.27/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-crypt.c	2008-10-21 17:32:24.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-crypt.c	2008-10-21 17:33:46.000000000 +0100
@@ -23,7 +23,7 @@
 #include <asm/page.h>
 #include <asm/unaligned.h>
 
-#include "dm.h"
+#include <linux/device-mapper.h>
 
 #define DM_MSG_PREFIX "crypt"
 #define MESG_STR(x) x, sizeof(x)
Index: linux-2.6.27/drivers/md/dm-delay.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-delay.c	2007-11-09 11:54:45.000000000 +0000
+++ linux-2.6.27/drivers/md/dm-delay.c	2008-10-21 17:33:46.000000000 +0100
@@ -13,7 +13,8 @@
 #include <linux/bio.h>
 #include <linux/slab.h>
 
-#include "dm.h"
+#include <linux/device-mapper.h>
+
 #include "dm-bio-list.h"
 
 #define DM_MSG_PREFIX "delay"
Index: linux-2.6.27/drivers/md/dm-exception-store.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-exception-store.c	2008-10-21 17:33:42.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-exception-store.c	2008-10-21 17:33:46.000000000 +0100
@@ -7,7 +7,6 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
 #include "dm-snap.h"
 
 #include <linux/mm.h>
Index: linux-2.6.27/drivers/md/dm-io.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-io.c	2008-04-26 02:13:42.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-io.c	2008-10-21 17:33:46.000000000 +0100
@@ -5,7 +5,7 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
 
 #include <linux/bio.h>
 #include <linux/mempool.h>
Index: linux-2.6.27/drivers/md/dm-kcopyd.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-kcopyd.c	2008-10-21 17:33:03.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-kcopyd.c	2008-10-21 17:33:46.000000000 +0100
@@ -22,6 +22,7 @@
 #include <linux/vmalloc.h>
 #include <linux/workqueue.h>
 #include <linux/mutex.h>
+#include <linux/device-mapper.h>
 #include <linux/dm-kcopyd.h>
 
 #include "dm.h"
Index: linux-2.6.27/drivers/md/dm-linear.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-linear.c	2008-07-22 05:15:07.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-linear.c	2008-10-21 17:33:46.000000000 +0100
@@ -5,12 +5,12 @@
  */
 
 #include "dm.h"
-
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/blkdev.h>
 #include <linux/bio.h>
 #include <linux/slab.h>
+#include <linux/device-mapper.h>
 
 #define DM_MSG_PREFIX "linear"
 
Index: linux-2.6.27/drivers/md/dm-log.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-log.c	2008-07-22 05:15:07.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-log.c	2008-10-21 17:33:46.000000000 +0100
@@ -12,7 +12,7 @@
 #include <linux/dm-io.h>
 #include <linux/dm-dirty-log.h>
 
-#include "dm.h"
+#include <linux/device-mapper.h>
 
 #define DM_MSG_PREFIX "dirty region log"
 
Index: linux-2.6.27/drivers/md/dm-mpath.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-mpath.c	2008-10-21 17:32:24.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-mpath.c	2008-10-21 17:33:46.000000000 +0100
@@ -5,7 +5,8 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
+
 #include "dm-path-selector.h"
 #include "dm-bio-list.h"
 #include "dm-bio-record.h"
Index: linux-2.6.27/drivers/md/dm-path-selector.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-path-selector.c	2007-11-09 11:54:45.000000000 +0000
+++ linux-2.6.27/drivers/md/dm-path-selector.c	2008-10-21 17:33:46.000000000 +0100
@@ -9,7 +9,8 @@
  * Path selector registration.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
+
 #include "dm-path-selector.h"
 
 #include <linux/slab.h>
Index: linux-2.6.27/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-raid1.c	2008-10-21 17:33:44.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-raid1.c	2008-10-21 17:33:46.000000000 +0100
@@ -4,7 +4,8 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
+
 #include "dm-bio-list.h"
 #include "dm-bio-record.h"
 
Index: linux-2.6.27/drivers/md/dm-round-robin.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-round-robin.c	2007-07-13 14:41:39.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-round-robin.c	2008-10-21 17:33:46.000000000 +0100
@@ -9,7 +9,8 @@
  * Round-robin path selector.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
+
 #include "dm-path-selector.h"
 
 #include <linux/slab.h>
Index: linux-2.6.27/drivers/md/dm-snap.h
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-snap.h	2008-10-21 17:33:39.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-snap.h	2008-10-21 17:33:46.000000000 +0100
@@ -9,7 +9,7 @@
 #ifndef DM_SNAPSHOT_H
 #define DM_SNAPSHOT_H
 
-#include "dm.h"
+#include <linux/device-mapper.h>
 #include "dm-bio-list.h"
 #include <linux/blkdev.h>
 #include <linux/workqueue.h>
Index: linux-2.6.27/drivers/md/dm-stripe.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-stripe.c	2008-10-21 17:33:44.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-stripe.c	2008-10-21 17:33:46.000000000 +0100
@@ -4,7 +4,7 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
 
 #include <linux/module.h>
 #include <linux/init.h>
Index: linux-2.6.27/drivers/md/dm-zero.c
===================================================================
--- linux-2.6.27.orig/drivers/md/dm-zero.c	2007-10-12 12:31:28.000000000 +0100
+++ linux-2.6.27/drivers/md/dm-zero.c	2008-10-21 17:33:46.000000000 +0100
@@ -4,7 +4,7 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
+#include <linux/device-mapper.h>
 
 #include <linux/module.h>
 #include <linux/init.h>