summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authortkusumi <tkusumi@NetBSD.org>2019-12-01 06:53:31 +0000
committertkusumi <tkusumi@NetBSD.org>2019-12-01 06:53:31 +0000
commit9969b9dc28caf2a5cc89f5c87d0930e24caab69e (patch)
tree7714c099cc4a3f7d215ff85501cc1a896402801e /sys/dev
parent7b816a505d3753358b6bae048646779ae08f3b17 (diff)
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.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/dm/dm.h17
-rw-r--r--sys/dev/dm/dm_ioctl.c5
-rw-r--r--sys/dev/dm/dm_target_error.c6
-rw-r--r--sys/dev/dm/dm_target_linear.c6
-rw-r--r--sys/dev/dm/dm_target_mirror.c6
-rw-r--r--sys/dev/dm/dm_target_snapshot.c7
-rw-r--r--sys/dev/dm/dm_target_stripe.c6
-rw-r--r--sys/dev/dm/dm_target_zero.c6
-rw-r--r--sys/dev/dm/doc/locking.txt2
9 files changed, 15 insertions, 46 deletions
diff --git a/sys/dev/dm/dm.h b/sys/dev/dm/dm.h
index b46f4f11c8f..635431e69c8 100644
--- a/sys/dev/dm/dm.h
+++ b/sys/dev/dm/dm.h
@@ -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 */
/*
diff --git a/sys/dev/dm/dm_ioctl.c b/sys/dev/dm/dm_ioctl.c
index 747ef596623..2272a275d5a 100644
--- a/sys/dev/dm/dm_ioctl.c
+++ b/sys/dev/dm/dm_ioctl.c
@@ -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_dict)
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);
diff --git a/sys/dev/dm/dm_target_error.c b/sys/dev/dm/dm_target_error.c
index c40b6443d4b..0a7e8e89b7f 100644
--- a/sys/dev/dm/dm_target_error.c
+++ b/sys/dev/dm/dm_target_error.c
@@ -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, void **target_config, char *argv)
*target_config = NULL;
- dmv->dev_type = DM_ERROR_DEV;
-
return 0;
}
diff --git a/sys/dev/dm/dm_target_linear.c b/sys/dev/dm/dm_target_linear.c
index 322f965f73a..d7545e6e336 100644
--- a/sys/dev/dm/dm_target_linear.c
+++ b/sys/dev/dm/dm_target_linear.c
@@ -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, void **target_config, char *params)
*target_config = tlc;
- dmv->dev_type = DM_LINEAR_DEV;
-
return 0;
}
diff --git a/sys/dev/dm/dm_target_mirror.c b/sys/dev/dm/dm_target_mirror.c
index 8087884faa1..0183f8ee204 100644
--- a/sys/dev/dm/dm_target_mirror.c
+++ b/sys/dev/dm/dm_target_mirror.c
@@ -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, void **target_config, char *argv)
*target_config = NULL;
- dmv->dev_type = DM_MIRROR_DEV;
-
return ENOSYS;
}
diff --git a/sys/dev/dm/dm_target_snapshot.c b/sys/dev/dm/dm_target_snapshot.c
index 76081704653..0173791678d 100644
--- a/sys/dev/dm/dm_target_snapshot.c
+++ b/sys/dev/dm/dm_target_snapshot.c
@@ -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, void **target_config, char *params)
*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 * dmv, void **target_config, char *params)
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;
diff --git a/sys/dev/dm/dm_target_stripe.c b/sys/dev/dm/dm_target_stripe.c
index 55c65a0b876..9ca44dce90b 100644
--- a/sys/dev/dm/dm_target_stripe.c
+++ b/sys/dev/dm/dm_target_stripe.c
@@ -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, void **target_config, char *params)
*target_config = tsc;
- dmv->dev_type = DM_STRIPE_DEV;
-
return 0;
}
diff --git a/sys/dev/dm/dm_target_zero.c b/sys/dev/dm/dm_target_zero.c
index 2861fc0bf61..c25e189a034 100644
--- a/sys/dev/dm/dm_target_zero.c
+++ b/sys/dev/dm/dm_target_zero.c
@@ -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 **target_config, char *argv)
printf("Zero target init function called!!\n");
- dmv->dev_type = DM_ZERO_DEV;
-
*target_config = NULL;
return 0;
diff --git a/sys/dev/dm/doc/locking.txt b/sys/dev/dm/doc/locking.txt
index 448140a673d..1147213f704 100644
--- a/sys/dev/dm/doc/locking.txt
+++ b/sys/dev/dm/doc/locking.txt
@@ -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;