Module Name:    src
Committed By:   tkusumi
Date:           Sun Dec  1 06:53:32 UTC 2019

Modified Files:
        src/sys/dev/dm: dm.h dm_ioctl.c dm_target_error.c dm_target_linear.c
            dm_target_mirror.c dm_target_snapshot.c dm_target_stripe.c
            dm_target_zero.c
        src/sys/dev/dm/doc: locking.txt

Log Message:
dm: Remove unused dm_dev::dev_type

Given OOP-like architecture of dm target device structure,
dm_dev doesn't need to have self contained target type field,
and in fact this is unused.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/dm/dm.h
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/dm/dm_ioctl.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/dm/dm_target_error.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dm/dm_target_linear.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/dm/dm_target_mirror.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/dm/dm_target_snapshot.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/dm/dm_target_stripe.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/dm/dm_target_zero.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/dm/doc/locking.txt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dm/dm.h
diff -u src/sys/dev/dm/dm.h:1.27 src/sys/dev/dm/dm.h:1.28
--- src/sys/dev/dm/dm.h:1.27	Thu Oct  2 21:58:16 2014
+++ src/sys/dev/dm/dm.h	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm.h,v 1.27 2014/10/02 21:58:16 justin Exp $      */
+/*        $NetBSD: dm.h,v 1.28 2019/12/01 06:53:31 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -139,8 +139,6 @@ typedef struct dm_dev {
 	uint32_t event_nr;
 	uint32_t ref_cnt;
 
-	uint32_t dev_type;
-
 	dm_table_head_t table_head;
 
 	struct dm_dev_head upcalls;
@@ -153,19 +151,6 @@ typedef struct dm_dev {
 	TAILQ_ENTRY(dm_dev) next_devlist; /* Major device list. */
 } dm_dev_t;
 
-/* Device types used for upcalls */
-#define DM_ZERO_DEV            (1 << 0)
-#define DM_ERROR_DEV           (1 << 1)
-#define DM_LINEAR_DEV          (1 << 2)
-#define DM_MIRROR_DEV          (1 << 3)
-#define DM_STRIPE_DEV          (1 << 4)
-#define DM_SNAPSHOT_DEV        (1 << 5)
-#define DM_SNAPSHOT_ORIG_DEV   (1 << 6)
-#define DM_SPARE_DEV           (1 << 7)
-/* Set this device type only during dev remove ioctl. */
-#define DM_DELETING_DEV        (1 << 8)
-
-
 /* for zero, error : dm_target->target_config == NULL */
 
 /*

Index: src/sys/dev/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.34 src/sys/dev/dm/dm_ioctl.c:1.35
--- src/sys/dev/dm/dm_ioctl.c:1.34	Sat Nov 30 05:35:57 2019
+++ src/sys/dev/dm/dm_ioctl.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.34 2019/11/30 05:35:57 tkusumi Exp $      */
+/* $NetBSD: dm_ioctl.c,v 1.35 2019/12/01 06:53:31 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.34 2019/11/30 05:35:57 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.35 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -246,7 +246,6 @@ dm_dev_create_ioctl(prop_dictionary_t dm
 	dmv->flags = 0;		/* device flags are set when needed */
 	dmv->ref_cnt = 0;
 	dmv->event_nr = 0;
-	dmv->dev_type = 0;
 	dmv->devt = devt;
 
 	dm_table_head_init(&dmv->table_head);

Index: src/sys/dev/dm/dm_target_error.c
diff -u src/sys/dev/dm/dm_target_error.c:1.12 src/sys/dev/dm/dm_target_error.c:1.13
--- src/sys/dev/dm/dm_target_error.c:1.12	Fri Jan  5 14:22:26 2018
+++ src/sys/dev/dm/dm_target_error.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_error.c,v 1.12 2018/01/05 14:22:26 christos Exp $      */
+/*        $NetBSD: dm_target_error.c,v 1.13 2019/12/01 06:53:31 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_error.c,v 1.12 2018/01/05 14:22:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_error.c,v 1.13 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper error target.
@@ -118,8 +118,6 @@ dm_target_error_init(dm_dev_t * dmv, voi
 
 	*target_config = NULL;
 
-	dmv->dev_type = DM_ERROR_DEV;
-
 	return 0;
 }
 

Index: src/sys/dev/dm/dm_target_linear.c
diff -u src/sys/dev/dm/dm_target_linear.c:1.18 src/sys/dev/dm/dm_target_linear.c:1.19
--- src/sys/dev/dm/dm_target_linear.c:1.18	Tue Oct 15 00:13:53 2019
+++ src/sys/dev/dm/dm_target_linear.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_linear.c,v 1.18 2019/10/15 00:13:53 chs Exp $      */
+/*        $NetBSD: dm_target_linear.c,v 1.19 2019/12/01 06:53:31 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.18 2019/10/15 00:13:53 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.19 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper dklinear target.
@@ -92,8 +92,6 @@ dm_target_linear_init(dm_dev_t * dmv, vo
 
 	*target_config = tlc;
 
-	dmv->dev_type = DM_LINEAR_DEV;
-
 	return 0;
 }
 

Index: src/sys/dev/dm/dm_target_mirror.c
diff -u src/sys/dev/dm/dm_target_mirror.c:1.10 src/sys/dev/dm/dm_target_mirror.c:1.11
--- src/sys/dev/dm/dm_target_mirror.c:1.10	Fri Jan  5 14:22:26 2018
+++ src/sys/dev/dm/dm_target_mirror.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_mirror.c,v 1.10 2018/01/05 14:22:26 christos Exp $*/
+/*$NetBSD: dm_target_mirror.c,v 1.11 2019/12/01 06:53:31 tkusumi Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_mirror.c,v 1.10 2018/01/05 14:22:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_mirror.c,v 1.11 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper mirror target.
@@ -122,8 +122,6 @@ dm_target_mirror_init(dm_dev_t * dmv, vo
 
 	*target_config = NULL;
 
-	dmv->dev_type = DM_MIRROR_DEV;
-
 	return ENOSYS;
 }
 

Index: src/sys/dev/dm/dm_target_snapshot.c
diff -u src/sys/dev/dm/dm_target_snapshot.c:1.20 src/sys/dev/dm/dm_target_snapshot.c:1.21
--- src/sys/dev/dm/dm_target_snapshot.c:1.20	Tue Oct 15 00:13:53 2019
+++ src/sys/dev/dm/dm_target_snapshot.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_snapshot.c,v 1.20 2019/10/15 00:13:53 chs Exp $      */
+/*        $NetBSD: dm_target_snapshot.c,v 1.21 2019/12/01 06:53:31 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_snapshot.c,v 1.20 2019/10/15 00:13:53 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_snapshot.c,v 1.21 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * 1. Suspend my_data to temporarily stop any I/O while the snapshot is being
@@ -243,7 +243,6 @@ dm_target_snapshot_init(dm_dev_t * dmv, 
 
 	*target_config = tsc;
 
-	dmv->dev_type = DM_SNAPSHOT_DEV;
 	dmv->sec_size = dmp_snap->dmp_secsize;
 
 	return 0;
@@ -411,8 +410,6 @@ dm_target_snapshot_orig_init(dm_dev_t * 
 	tsoc = kmem_alloc(sizeof(dm_target_snapshot_origin_config_t), KM_SLEEP);
 	tsoc->tsoc_real_dev = dmp_real;
 
-	dmv->dev_type = DM_SNAPSHOT_ORIG_DEV;
-
 	*target_config = tsoc;
 
 	return 0;

Index: src/sys/dev/dm/dm_target_stripe.c
diff -u src/sys/dev/dm/dm_target_stripe.c:1.24 src/sys/dev/dm/dm_target_stripe.c:1.25
--- src/sys/dev/dm/dm_target_stripe.c:1.24	Tue Oct 15 00:13:53 2019
+++ src/sys/dev/dm/dm_target_stripe.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_stripe.c,v 1.24 2019/10/15 00:13:53 chs Exp $*/
+/*$NetBSD: dm_target_stripe.c,v 1.25 2019/12/01 06:53:31 tkusumi Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_stripe.c,v 1.24 2019/10/15 00:13:53 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_stripe.c,v 1.25 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper stripe target.
@@ -187,8 +187,6 @@ dm_target_stripe_init(dm_dev_t * dmv, vo
 
 	*target_config = tsc;
 
-	dmv->dev_type = DM_STRIPE_DEV;
-
 	return 0;
 }
 

Index: src/sys/dev/dm/dm_target_zero.c
diff -u src/sys/dev/dm/dm_target_zero.c:1.13 src/sys/dev/dm/dm_target_zero.c:1.14
--- src/sys/dev/dm/dm_target_zero.c:1.13	Fri Jan  5 14:22:26 2018
+++ src/sys/dev/dm/dm_target_zero.c	Sun Dec  1 06:53:31 2019
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_zero.c,v 1.13 2018/01/05 14:22:26 christos Exp $      */
+/*        $NetBSD: dm_target_zero.c,v 1.14 2019/12/01 06:53:31 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_zero.c,v 1.13 2018/01/05 14:22:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_zero.c,v 1.14 2019/12/01 06:53:31 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper zero target.
@@ -119,8 +119,6 @@ dm_target_zero_init(dm_dev_t * dmv, void
 
 	printf("Zero target init function called!!\n");
 
-	dmv->dev_type = DM_ZERO_DEV;
-
 	*target_config = NULL;
 
 	return 0;

Index: src/sys/dev/dm/doc/locking.txt
diff -u src/sys/dev/dm/doc/locking.txt:1.1 src/sys/dev/dm/doc/locking.txt:1.2
--- src/sys/dev/dm/doc/locking.txt:1.1	Sat Oct 23 21:18:55 2010
+++ src/sys/dev/dm/doc/locking.txt	Sun Dec  1 06:53:32 2019
@@ -49,8 +49,6 @@ typedef struct dm_dev {
         uint32_t event_nr;
         uint32_t ref_cnt;
 
-        uint32_t dev_type;
-
         dm_table_head_t table_head;
 
         struct dm_dev_head upcalls;

Reply via email to