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: Fix strange pointer declarations



details:   https://anonhg.NetBSD.org/src/rev/bae03523244a
branches:  trunk
changeset: 465925:bae03523244a
user:      tkusumi <tkusumi%NetBSD.org@localhost>
date:      Sat Dec 07 15:28:39 2019 +0000

description:
dm: Fix strange pointer declarations

Should be "type *name" or "type* name", but not "type * name".
taken-from: DragonFlyBSD

diffstat:

 sys/dev/dm/dm.h                 |   8 ++++----
 sys/dev/dm/dm_dev.c             |  14 +++++++-------
 sys/dev/dm/dm_pdev.c            |   8 ++++----
 sys/dev/dm/dm_table.c           |  30 +++++++++++++++---------------
 sys/dev/dm/dm_target.c          |  10 +++++-----
 sys/dev/dm/dm_target_error.c    |  18 +++++++++---------
 sys/dev/dm/dm_target_linear.c   |  18 +++++++++---------
 sys/dev/dm/dm_target_mirror.c   |  18 +++++++++---------
 sys/dev/dm/dm_target_snapshot.c |  31 +++++++++++++++----------------
 sys/dev/dm/dm_target_stripe.c   |  18 +++++++++---------
 sys/dev/dm/dm_target_zero.c     |  18 +++++++++---------
 sys/dev/dm/doc/locking.txt      |   2 +-
 12 files changed, 96 insertions(+), 97 deletions(-)

diffs (truncated from 865 to 300 lines):

diff -r 5d2edac784f8 -r bae03523244a sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h   Sat Dec 07 15:13:59 2019 +0000
+++ b/sys/dev/dm/dm.h   Sat Dec 07 15:28:39 2019 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm.h,v 1.33 2019/12/05 15:52:39 tkusumi Exp $      */
+/*        $NetBSD: dm.h,v 1.34 2019/12/07 15:28:39 tkusumi Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -276,7 +276,7 @@
 
 /* dm_target_linear.c */
 int dm_target_linear_init(dm_dev_t *, void**, char *);
-char * dm_target_linear_status(void *);
+char *dm_target_linear_status(void *);
 int dm_target_linear_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_linear_sync(dm_table_entry_t *);
 int dm_target_linear_deps(dm_table_entry_t *, prop_array_t);
@@ -289,7 +289,7 @@
 
 /* dm_target_stripe.c */
 int dm_target_stripe_init(dm_dev_t *, void**, char *);
-char * dm_target_stripe_status(void *);
+char *dm_target_stripe_status(void *);
 int dm_target_stripe_strategy(dm_table_entry_t *, struct buf *);
 int dm_target_stripe_sync(dm_table_entry_t *);
 int dm_target_stripe_deps(dm_table_entry_t *, prop_array_t);
@@ -305,7 +305,7 @@
 uint64_t dm_table_size(dm_table_head_t *);
 uint64_t dm_inactive_table_size(dm_table_head_t *);
 void dm_table_disksize(dm_table_head_t *, uint64_t *, unsigned *);
-dm_table_t * dm_table_get_entry(dm_table_head_t *, uint8_t);
+dm_table_t *dm_table_get_entry(dm_table_head_t *, uint8_t);
 int dm_table_get_target_count(dm_table_head_t *, uint8_t);
 void dm_table_release(dm_table_head_t *, uint8_t s);
 void dm_table_switch_tables(dm_table_head_t *);
diff -r 5d2edac784f8 -r bae03523244a sys/dev/dm/dm_dev.c
--- a/sys/dev/dm/dm_dev.c       Sat Dec 07 15:13:59 2019 +0000
+++ b/sys/dev/dm/dm_dev.c       Sat Dec 07 15:28:39 2019 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_dev.c,v 1.13 2019/12/04 15:31:12 tkusumi Exp $      */
+/*        $NetBSD: dm_dev.c,v 1.14 2019/12/07 15:28:39 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_dev.c,v 1.13 2019/12/04 15:31:12 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_dev.c,v 1.14 2019/12/07 15:28:39 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -54,7 +54,7 @@
 
 /* dm_dev_mutex must be holdby caller before using disable_dev. */
 __inline static void
-disable_dev(dm_dev_t * dmv)
+disable_dev(dm_dev_t *dmv)
 {
        TAILQ_REMOVE(&dm_dev_list, dmv, next_devlist);
        mutex_enter(&dmv->dev_mtx);
@@ -175,7 +175,7 @@
  * Insert new device to the global list of devices.
  */
 int
-dm_dev_insert(dm_dev_t * dev)
+dm_dev_insert(dm_dev_t *dev)
 {
        dm_dev_t *dmv;
        int r;
@@ -331,7 +331,7 @@
  * Freed device entry.
  */
 int
-dm_dev_free(dm_dev_t * dmv)
+dm_dev_free(dm_dev_t *dmv)
 {
        KASSERT(dmv != NULL);
 
@@ -348,7 +348,7 @@
 }
 
 void
-dm_dev_busy(dm_dev_t * dmv)
+dm_dev_busy(dm_dev_t *dmv)
 {
        mutex_enter(&dmv->dev_mtx);
        dmv->ref_cnt++;
@@ -356,7 +356,7 @@
 }
 
 void
-dm_dev_unbusy(dm_dev_t * dmv)
+dm_dev_unbusy(dm_dev_t *dmv)
 {
        KASSERT(dmv->ref_cnt != 0);
 
diff -r 5d2edac784f8 -r bae03523244a sys/dev/dm/dm_pdev.c
--- a/sys/dev/dm/dm_pdev.c      Sat Dec 07 15:13:59 2019 +0000
+++ b/sys/dev/dm/dm_pdev.c      Sat Dec 07 15:28:39 2019 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_pdev.c,v 1.17 2019/12/07 06:26:31 tkusumi Exp $      */
+/*        $NetBSD: dm_pdev.c,v 1.18 2019/12/07 15:28:39 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_pdev.c,v 1.17 2019/12/07 06:26:31 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.18 2019/12/07 15:28:39 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -167,7 +167,7 @@
  * Destroy allocated dm_pdev.
  */
 static int
-dm_pdev_rem(dm_pdev_t * dmp)
+dm_pdev_rem(dm_pdev_t *dmp)
 {
 
        KASSERT(dmp != NULL);
@@ -216,7 +216,7 @@
  * Decrement pdev reference counter if 0 remove it.
  */
 int
-dm_pdev_decr(dm_pdev_t * dmp)
+dm_pdev_decr(dm_pdev_t *dmp)
 {
        KASSERT(dmp != NULL);
        /*
diff -r 5d2edac784f8 -r bae03523244a sys/dev/dm/dm_table.c
--- a/sys/dev/dm/dm_table.c     Sat Dec 07 15:13:59 2019 +0000
+++ b/sys/dev/dm/dm_table.c     Sat Dec 07 15:28:39 2019 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_table.c,v 1.11 2019/12/07 06:26:31 tkusumi Exp $      */
+/*        $NetBSD: dm_table.c,v 1.12 2019/12/07 15:28:39 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_table.c,v 1.11 2019/12/07 06:26:31 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.12 2019/12/07 15:28:39 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -63,7 +63,7 @@
  * DM_TABLE_INACTIVE will return inactive table id.
  */
 static int
-dm_table_busy(dm_table_head_t * head, uint8_t table_id)
+dm_table_busy(dm_table_head_t *head, uint8_t table_id)
 {
        uint8_t id;
 
@@ -84,7 +84,7 @@
  * Function release table lock and eventually wakeup all waiters.
  */
 static void
-dm_table_unbusy(dm_table_head_t * head)
+dm_table_unbusy(dm_table_head_t *head)
 {
        KASSERT(head->io_cnt != 0);
 
@@ -100,7 +100,7 @@
  * Return current active table to caller, increment io_cnt reference counter.
  */
 dm_table_t *
-dm_table_get_entry(dm_table_head_t * head, uint8_t table_id)
+dm_table_get_entry(dm_table_head_t *head, uint8_t table_id)
 {
        uint8_t id;
 
@@ -112,7 +112,7 @@
  * Decrement io reference counter and wake up all callers, with table_head cv.
  */
 void
-dm_table_release(dm_table_head_t * head, uint8_t table_id)
+dm_table_release(dm_table_head_t *head, uint8_t table_id)
 {
        dm_table_unbusy(head);
 }
@@ -121,7 +121,7 @@
  * Switch table from inactive to active mode. Have to wait until io_cnt is 0.
  */
 void
-dm_table_switch_tables(dm_table_head_t * head)
+dm_table_switch_tables(dm_table_head_t *head)
 {
        mutex_enter(&head->table_mtx);
 
@@ -140,7 +140,7 @@
  * XXX Is it ok to call kmem_free and potentialy VOP_CLOSE with held mutex ?xs
  */
 int
-dm_table_destroy(dm_table_head_t * head, uint8_t table_id)
+dm_table_destroy(dm_table_head_t *head, uint8_t table_id)
 {
        dm_table_t *tbl;
        dm_table_entry_t *table_en;
@@ -178,7 +178,7 @@
  * Return length of active table in device.
  */
 static inline uint64_t
-dm_table_size_impl(dm_table_head_t * head, int table)
+dm_table_size_impl(dm_table_head_t *head, int table)
 {
        dm_table_t *tbl;
        dm_table_entry_t *table_en;
@@ -208,7 +208,7 @@
  * Return length of active table in device.
  */
 uint64_t
-dm_table_size(dm_table_head_t * head)
+dm_table_size(dm_table_head_t *head)
 {
        return dm_table_size_impl(head, DM_TABLE_ACTIVE);
 }
@@ -217,7 +217,7 @@
  * Return length of active table in device.
  */
 uint64_t
-dm_inactive_table_size(dm_table_head_t * head)
+dm_inactive_table_size(dm_table_head_t *head)
 {
        return dm_table_size_impl(head, DM_TABLE_INACTIVE);
 }
@@ -226,7 +226,7 @@
  * Return combined disk geometry
  */
 void
-dm_table_disksize(dm_table_head_t * head, uint64_t *numsecp, unsigned *secsizep)
+dm_table_disksize(dm_table_head_t *head, uint64_t *numsecp, unsigned *secsizep)
 {
        dm_table_t *tbl;
        dm_table_entry_t *table_en;
@@ -265,7 +265,7 @@
  * there can be dm_dev_resume_ioctl), therfore this isonly informative.
  */
 int
-dm_table_get_target_count(dm_table_head_t * head, uint8_t table_id)
+dm_table_get_target_count(dm_table_head_t *head, uint8_t table_id)
 {
        dm_table_entry_t *table_en;
        dm_table_t *tbl;
@@ -292,7 +292,7 @@
  * opaque as possible.
  */
 void
-dm_table_head_init(dm_table_head_t * head)
+dm_table_head_init(dm_table_head_t *head)
 {
        head->cur_active_table = 0;
        head->io_cnt = 0;
@@ -309,7 +309,7 @@
  * Destroy all variables in table_head
  */
 void
-dm_table_head_destroy(dm_table_head_t * head)
+dm_table_head_destroy(dm_table_head_t *head)
 {
        KASSERT(!mutex_owned(&head->table_mtx));
        KASSERT(!cv_has_waiters(&head->table_cv));
diff -r 5d2edac784f8 -r bae03523244a sys/dev/dm/dm_target.c
--- a/sys/dev/dm/dm_target.c    Sat Dec 07 15:13:59 2019 +0000
+++ b/sys/dev/dm/dm_target.c    Sat Dec 07 15:28:39 2019 +0000
@@ -1,4 +1,4 @@
-/*        $NetBSD: dm_target.c,v 1.24 2019/12/07 06:26:31 tkusumi Exp $      */
+/*        $NetBSD: dm_target.c,v 1.25 2019/12/07 15:28:39 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.24 2019/12/07 06:26:31 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.25 2019/12/07 15:28:39 tkusumi Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -54,7 +54,7 @@
  * Called indirectly from dm_table_load_ioctl to mark target as used.
  */
 void
-dm_target_busy(dm_target_t * target)
+dm_target_busy(dm_target_t *target)
 {
        atomic_inc_32(&target->ref_cnt);
 }
@@ -63,7 +63,7 @@
  * Release reference counter on target.
  */



Home | Main Index | Thread Index | Old Index