Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dm dm: Remove unused dm_dev::dev_type



details:   https://anonhg.NetBSD.org/src/rev/a7fd82bca0bd
branches:  trunk
changeset: 846758:a7fd82bca0bd
user:      tkusumi <tkusumi%NetBSD.org@localhost>
date:      Sun Dec 01 06:53:31 2019 +0000

description:
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:

 sys/dev/dm/dm.h                 |  17 +----------------
 sys/dev/dm/dm_ioctl.c           |   5 ++---
 sys/dev/dm/dm_target_error.c    |   6 ++----
 sys/dev/dm/dm_target_linear.c   |   6 ++----
 sys/dev/dm/dm_target_mirror.c   |   6 ++----
 sys/dev/dm/dm_target_snapshot.c |   7 ++-----
 sys/dev/dm/dm_target_stripe.c   |   6 ++----
 sys/dev/dm/dm_target_zero.c     |   6 ++----
 sys/dev/dm/doc/locking.txt      |   2 --
 9 files changed, 15 insertions(+), 46 deletions(-)

diffs (246 lines):

diff -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h   Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm.h   Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
        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 @@
        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 -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_ioctl.c
--- a/sys/dev/dm/dm_ioctl.c     Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_ioctl.c     Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
        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 -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_target_error.c
--- a/sys/dev/dm/dm_target_error.c      Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_target_error.c      Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
 
        *target_config = NULL;
 
-       dmv->dev_type = DM_ERROR_DEV;
-
        return 0;
 }
 
diff -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_target_linear.c
--- a/sys/dev/dm/dm_target_linear.c     Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_target_linear.c     Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
 
        *target_config = tlc;
 
-       dmv->dev_type = DM_LINEAR_DEV;
-
        return 0;
 }
 
diff -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_target_mirror.c
--- a/sys/dev/dm/dm_target_mirror.c     Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_target_mirror.c     Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
 
        *target_config = NULL;
 
-       dmv->dev_type = DM_MIRROR_DEV;
-
        return ENOSYS;
 }
 
diff -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_target_snapshot.c
--- a/sys/dev/dm/dm_target_snapshot.c   Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_target_snapshot.c   Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
 
        *target_config = tsc;
 
-       dmv->dev_type = DM_SNAPSHOT_DEV;
        dmv->sec_size = dmp_snap->dmp_secsize;
 
        return 0;
@@ -411,8 +410,6 @@
        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 -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_target_stripe.c
--- a/sys/dev/dm/dm_target_stripe.c     Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_target_stripe.c     Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
 
        *target_config = tsc;
 
-       dmv->dev_type = DM_STRIPE_DEV;
-
        return 0;
 }
 
diff -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/dm_target_zero.c
--- a/sys/dev/dm/dm_target_zero.c       Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/dm_target_zero.c       Sun Dec 01 06:53:31 2019 +0000
@@ -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 @@
 
        printf("Zero target init function called!!\n");
 
-       dmv->dev_type = DM_ZERO_DEV;
-
        *target_config = NULL;
 
        return 0;
diff -r 4c46e0164c50 -r a7fd82bca0bd sys/dev/dm/doc/locking.txt
--- a/sys/dev/dm/doc/locking.txt        Sat Nov 30 23:06:52 2019 +0000
+++ b/sys/dev/dm/doc/locking.txt        Sun Dec 01 06:53:31 2019 +0000
@@ -49,8 +49,6 @@
         uint32_t event_nr;
         uint32_t ref_cnt;
 
-        uint32_t dev_type;
-
         dm_table_head_t table_head;
 
         struct dm_dev_head upcalls;



Home | Main Index | Thread Index | Old Index