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: #if0 target's ->upcall() handler



details:   https://anonhg.NetBSD.org/src/rev/71dcfce78f02
branches:  trunk
changeset: 968597:71dcfce78f02
user:      tkusumi <tkusumi%NetBSD.org@localhost>
date:      Tue Jan 21 16:27:53 2020 +0000

description:
dm: #if0 target's ->upcall() handler

This is part of NetBSD's dm design, but unimplemented
(all handlers return 0) and also unused.

diffstat:

 sys/dev/dm/dm.h                 |  16 ++++++++--------
 sys/dev/dm/dm_target.c          |  18 ++++++++++--------
 sys/dev/dm/dm_target_delay.c    |   8 +++++---
 sys/dev/dm/dm_target_error.c    |   8 +++++---
 sys/dev/dm/dm_target_flakey.c   |   8 +++++---
 sys/dev/dm/dm_target_linear.c   |   6 ++++--
 sys/dev/dm/dm_target_mirror.c   |  10 ++++++----
 sys/dev/dm/dm_target_snapshot.c |  16 ++++++++++------
 sys/dev/dm/dm_target_stripe.c   |   8 +++++---
 sys/dev/dm/dm_target_zero.c     |   8 +++++---
 10 files changed, 63 insertions(+), 43 deletions(-)

diffs (truncated from 527 to 300 lines):

diff -r 59596f749df6 -r 71dcfce78f02 sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h   Tue Jan 21 15:26:36 2020 +0000
+++ b/sys/dev/dm/dm.h   Tue Jan 21 16:27:53 2020 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm.h,v 1.54 2020/01/05 08:08:26 tkusumi Exp $      */
+/*        $NetBSD: dm.h,v 1.55 2020/01/21 16:27:53 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -182,7 +182,7 @@
        int (*destroy)(dm_table_entry_t *);
 
        int (*strategy)(dm_table_entry_t *, struct buf *);
-       int (*upcall)(dm_table_entry_t *, struct buf *);
+       //int (*upcall)(dm_table_entry_t *, struct buf *);
 
        /*
         * Optional routines.
@@ -247,7 +247,7 @@
 int dm_target_linear_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_linear_sync(dm_table_entry_t *);
 int dm_target_linear_destroy(dm_table_entry_t *);
-int dm_target_linear_upcall(dm_table_entry_t *, struct buf *);
+//int dm_target_linear_upcall(dm_table_entry_t *, struct buf *);
 int dm_target_linear_secsize(dm_table_entry_t *, unsigned int *);
 
 /* dm_target_stripe.c */
@@ -257,20 +257,20 @@
 int dm_target_stripe_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_stripe_sync(dm_table_entry_t *);
 int dm_target_stripe_destroy(dm_table_entry_t *);
-int dm_target_stripe_upcall(dm_table_entry_t *, struct buf *);
+//int dm_target_stripe_upcall(dm_table_entry_t *, struct buf *);
 int dm_target_stripe_secsize(dm_table_entry_t *, unsigned int *);
 
 /* dm_target_error.c */
 int dm_target_error_init(dm_table_entry_t*, int, char **);
 int dm_target_error_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_error_destroy(dm_table_entry_t *);
-int dm_target_error_upcall(dm_table_entry_t *, struct buf *);
+//int dm_target_error_upcall(dm_table_entry_t *, struct buf *);
 
 /* dm_target_zero.c */
 int dm_target_zero_init(dm_table_entry_t *, int, char **);
 int dm_target_zero_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_zero_destroy(dm_table_entry_t *);
-int dm_target_zero_upcall(dm_table_entry_t *, struct buf *);
+//int dm_target_zero_upcall(dm_table_entry_t *, struct buf *);
 
 #if 0
 /* dm_target_delay.c */
@@ -282,7 +282,7 @@
 int dm_target_delay_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_delay_sync(dm_table_entry_t *);
 int dm_target_delay_destroy(dm_table_entry_t *);
-int dm_target_delay_upcall(dm_table_entry_t *, struct buf *);
+//int dm_target_delay_upcall(dm_table_entry_t *, struct buf *);
 int dm_target_delay_secsize(dm_table_entry_t *, unsigned int *);
 
 /* dm_target_flakey.c */
@@ -291,7 +291,7 @@
 int dm_target_flakey_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_flakey_sync(dm_table_entry_t *);
 int dm_target_flakey_destroy(dm_table_entry_t *);
-int dm_target_flakey_upcall(dm_table_entry_t *, struct buf *);
+//int dm_target_flakey_upcall(dm_table_entry_t *, struct buf *);
 int dm_target_flakey_secsize(dm_table_entry_t *, unsigned int *);
 #endif
 
diff -r 59596f749df6 -r 71dcfce78f02 sys/dev/dm/dm_target.c
--- a/sys/dev/dm/dm_target.c    Tue Jan 21 15:26:36 2020 +0000
+++ b/sys/dev/dm/dm_target.c    Tue Jan 21 16:27:53 2020 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target.c,v 1.39 2020/01/05 08:08:26 tkusumi Exp $      */
+/*        $NetBSD: dm_target.c,v 1.40 2020/01/21 16:27:53 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.c,v 1.39 2020/01/05 08:08:26 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.40 2020/01/21 16:27:53 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -168,10 +168,12 @@
                printf("%s missing destroy\n", dm_target->name);
                return EINVAL;
        }
+#if 0
        if (dm_target->upcall == NULL) {
                printf("%s missing upcall\n", dm_target->name);
                return EINVAL;
        }
+#endif
 
        mutex_enter(&dm_target_mutex);
 
@@ -320,7 +322,7 @@
        dmt->strategy = &dm_target_linear_strategy;
        dmt->sync = &dm_target_linear_sync;
        dmt->destroy = &dm_target_linear_destroy;
-       dmt->upcall = &dm_target_linear_upcall;
+       //dmt->upcall = &dm_target_linear_upcall;
        dmt->secsize = &dm_target_linear_secsize;
        if (dm_target_insert(dmt))
                printf("Failed to insert linear\n");
@@ -335,7 +337,7 @@
        dmt->strategy = &dm_target_stripe_strategy;
        dmt->sync = &dm_target_stripe_sync;
        dmt->destroy = &dm_target_stripe_destroy;
-       dmt->upcall = &dm_target_stripe_upcall;
+       //dmt->upcall = &dm_target_stripe_upcall;
        dmt->secsize = &dm_target_stripe_secsize;
        if (dm_target_insert(dmt))
                printf("Failed to insert striped\n");
@@ -347,7 +349,7 @@
        dmt->init = &dm_target_error_init;
        dmt->strategy = &dm_target_error_strategy;
        dmt->destroy = &dm_target_error_destroy;
-       dmt->upcall = &dm_target_error_upcall;
+       //dmt->upcall = &dm_target_error_upcall;
        if (dm_target_insert(dmt))
                printf("Failed to insert error\n");
 
@@ -358,7 +360,7 @@
        dmt->init = &dm_target_zero_init;
        dmt->strategy = &dm_target_zero_strategy;
        dmt->destroy = &dm_target_zero_destroy;
-       dmt->upcall = &dm_target_zero_upcall;
+       //dmt->upcall = &dm_target_zero_upcall;
        if (dm_target_insert(dmt))
                printf("Failed to insert zero\n");
 #if 0
@@ -372,7 +374,7 @@
        dmt->strategy = &dm_target_delay_strategy;
        dmt->sync = &dm_target_delay_sync;
        dmt->destroy = &dm_target_delay_destroy;
-       dmt->upcall = &dm_target_delay_upcall;
+       //dmt->upcall = &dm_target_delay_upcall;
        dmt->secsize = &dm_target_delay_secsize;
        if (dm_target_insert(dmt))
                printf("Failed to insert delay\n");
@@ -387,7 +389,7 @@
        dmt->strategy = &dm_target_flakey_strategy;
        dmt->sync = &dm_target_flakey_sync;
        dmt->destroy = &dm_target_flakey_destroy;
-       dmt->upcall = &dm_target_flakey_upcall;
+       //dmt->upcall = &dm_target_flakey_upcall;
        dmt->secsize = &dm_target_flakey_secsize;
        if (dm_target_insert(dmt))
                printf("Failed to insert flakey\n");
diff -r 59596f749df6 -r 71dcfce78f02 sys/dev/dm/dm_target_delay.c
--- a/sys/dev/dm/dm_target_delay.c      Tue Jan 21 15:26:36 2020 +0000
+++ b/sys/dev/dm/dm_target_delay.c      Tue Jan 21 16:27:53 2020 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_delay.c,v 1.1 2020/01/05 08:08:26 tkusumi Exp $      */
+/*        $NetBSD: dm_target_delay.c,v 1.2 2020/01/21 16:27:53 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_delay.c,v 1.1 2020/01/05 08:08:26 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_delay.c,v 1.2 2020/01/21 16:27:53 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -118,7 +118,7 @@
                dmt->strategy = &dm_target_delay_strategy;
                dmt->sync = &dm_target_delay_sync;
                dmt->destroy = &dm_target_delay_destroy;
-               dmt->upcall = &dm_target_delay_upcall;
+               //dmt->upcall = &dm_target_delay_upcall;
                dmt->secsize = &dm_target_delay_secsize;
 
                dm_target_delay_pool_create();
@@ -425,12 +425,14 @@
        dm_pdev_decr(di->pdev);
 }
 
+#if 0
 int
 dm_target_delay_upcall(dm_table_entry_t *table_en, struct buf *bp)
 {
 
        return 0;
 }
+#endif
 
 int
 dm_target_delay_secsize(dm_table_entry_t *table_en, unsigned int *secsizep)
diff -r 59596f749df6 -r 71dcfce78f02 sys/dev/dm/dm_target_error.c
--- a/sys/dev/dm/dm_target_error.c      Tue Jan 21 15:26:36 2020 +0000
+++ b/sys/dev/dm/dm_target_error.c      Tue Jan 21 16:27:53 2020 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_error.c,v 1.28 2019/12/23 16:17:35 tkusumi Exp $      */
+/*        $NetBSD: dm_target_error.c,v 1.29 2020/01/21 16:27:53 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.28 2019/12/23 16:17:35 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_error.c,v 1.29 2020/01/21 16:27:53 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper error target.
@@ -73,7 +73,7 @@
                dmt->init = &dm_target_error_init;
                dmt->strategy = &dm_target_error_strategy;
                dmt->destroy = &dm_target_error_destroy;
-               dmt->upcall = &dm_target_error_upcall;
+               //dmt->upcall = &dm_target_error_upcall;
 
                r = dm_target_insert(dmt);
 
@@ -135,6 +135,7 @@
        return 0;
 }
 
+#if 0
 /* Unsupported for this target. */
 int
 dm_target_error_upcall(dm_table_entry_t *table_en, struct buf *bp)
@@ -142,3 +143,4 @@
 
        return 0;
 }
+#endif
diff -r 59596f749df6 -r 71dcfce78f02 sys/dev/dm/dm_target_flakey.c
--- a/sys/dev/dm/dm_target_flakey.c     Tue Jan 21 15:26:36 2020 +0000
+++ b/sys/dev/dm/dm_target_flakey.c     Tue Jan 21 16:27:53 2020 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_flakey.c,v 1.2 2020/01/05 08:11:10 tkusumi Exp $      */
+/*        $NetBSD: dm_target_flakey.c,v 1.3 2020/01/21 16:27:53 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_target_flakey.c,v 1.2 2020/01/05 08:11:10 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_flakey.c,v 1.3 2020/01/21 16:27:53 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -107,7 +107,7 @@
                dmt->strategy = &dm_target_flakey_strategy;
                dmt->sync = &dm_target_flakey_sync;
                dmt->destroy = &dm_target_flakey_destroy;
-               dmt->upcall = &dm_target_flakey_upcall;
+               //dmt->upcall = &dm_target_flakey_upcall;
                dmt->secsize = &dm_target_flakey_secsize;
 
                r = dm_target_insert(dmt);
@@ -494,12 +494,14 @@
        return 0;
 }
 
+#if 0
 int
 dm_target_flakey_upcall(dm_table_entry_t *table_en, struct buf *bp)
 {
 
        return 0;
 }
+#endif
 
 int
 dm_target_flakey_secsize(dm_table_entry_t *table_en, unsigned int *secsizep)
diff -r 59596f749df6 -r 71dcfce78f02 sys/dev/dm/dm_target_linear.c
--- a/sys/dev/dm/dm_target_linear.c     Tue Jan 21 15:26:36 2020 +0000
+++ b/sys/dev/dm/dm_target_linear.c     Tue Jan 21 16:27:53 2020 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target_linear.c,v 1.36 2019/12/28 15:38:16 tkusumi Exp $      */
+/*        $NetBSD: dm_target_linear.c,v 1.37 2020/01/21 16:27:53 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.36 2019/12/28 15:38:16 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.37 2020/01/21 16:27:53 tkusumi Exp $");
 
 /*
  * This file implements initial version of device-mapper linear target.
@@ -163,6 +163,7 @@
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index