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: Move targets specific structs to .c files
details: https://anonhg.NetBSD.org/src/rev/a12f173d9d82
branches: trunk
changeset: 465958:a12f173d9d82
user: tkusumi <tkusumi%NetBSD.org@localhost>
date: Sun Dec 08 10:50:21 2019 +0000
description:
dm: Move targets specific structs to .c files
These don't need to be defined and exposed in dm.h.
diffstat:
sys/dev/dm/dm.h | 41 +----------------------------------------
sys/dev/dm/dm_target_mirror.c | 16 ++++++++++++++--
sys/dev/dm/dm_target_snapshot.c | 18 ++++++++++++++++--
sys/dev/dm/dm_target_stripe.c | 12 ++++++++++--
4 files changed, 41 insertions(+), 46 deletions(-)
diffs (164 lines):
diff -r cf39d77ece36 -r a12f173d9d82 sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h Sun Dec 08 10:37:19 2019 +0000
+++ b/sys/dev/dm/dm.h Sun Dec 08 10:50:21 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm.h,v 1.36 2019/12/08 10:35:53 tkusumi Exp $ */
+/* $NetBSD: dm.h,v 1.37 2019/12/08 10:50:21 tkusumi Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -170,45 +170,6 @@
typedef struct target_linear_devs dm_target_linear_devs_t;
-/* for stripe : */
-typedef struct target_stripe_config {
-#define DM_STRIPE_DEV_OFFSET 2
- struct target_linear_devs stripe_devs;
- uint8_t stripe_num;
- uint64_t stripe_chunksize;
- size_t params_len;
-} dm_target_stripe_config_t;
-
-/* for mirror : */
-typedef struct target_mirror_config {
-#define MAX_MIRROR_COPIES 4
- dm_pdev_t *orig;
- dm_pdev_t *copies[MAX_MIRROR_COPIES];
-
- /* copied blocks bitmaps administration etc*/
- dm_pdev_t *log_pdev; /* for administration */
- uint64_t log_regionsize; /* blocksize of mirror */
-
- /* list of parts that still need copied etc.; run length encoded? */
-} dm_target_mirror_config_t;
-
-
-/* for snapshot : */
-typedef struct target_snapshot_config {
- dm_pdev_t *tsc_snap_dev;
- /* cow dev is set only for persistent snapshot devices */
- dm_pdev_t *tsc_cow_dev;
-
- uint64_t tsc_chunk_size;
- uint32_t tsc_persistent_dev;
-} dm_target_snapshot_config_t;
-
-/* for snapshot-origin devices */
-typedef struct target_snapshot_origin_config {
- dm_pdev_t *tsoc_real_dev;
- /* list of snapshots ? */
-} dm_target_snapshot_origin_config_t;
-
/* constant dm_target structures for error, zero, linear, stripes etc. */
typedef struct dm_target {
char name[DM_MAX_TYPE_NAME];
diff -r cf39d77ece36 -r a12f173d9d82 sys/dev/dm/dm_target_mirror.c
--- a/sys/dev/dm/dm_target_mirror.c Sun Dec 08 10:37:19 2019 +0000
+++ b/sys/dev/dm/dm_target_mirror.c Sun Dec 08 10:50:21 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_mirror.c,v 1.15 2019/12/08 04:41:02 tkusumi Exp $*/
+/*$NetBSD: dm_target_mirror.c,v 1.16 2019/12/08 10:50:21 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.15 2019/12/08 04:41:02 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_mirror.c,v 1.16 2019/12/08 10:50:21 tkusumi Exp $");
/*
* This file implements initial version of device-mapper mirror target.
@@ -50,6 +50,18 @@
int dm_target_mirror_destroy(dm_table_entry_t *);
int dm_target_mirror_upcall(dm_table_entry_t *, struct buf *);
+typedef struct target_mirror_config {
+#define MAX_MIRROR_COPIES 4
+ dm_pdev_t *orig;
+ dm_pdev_t *copies[MAX_MIRROR_COPIES];
+
+ /* copied blocks bitmaps administration etc*/
+ dm_pdev_t *log_pdev; /* for administration */
+ uint64_t log_regionsize; /* blocksize of mirror */
+
+ /* list of parts that still need copied etc.; run length encoded? */
+} dm_target_mirror_config_t;
+
#ifdef DM_TARGET_MODULE
/*
* Every target can be compiled directly to dm driver or as a
diff -r cf39d77ece36 -r a12f173d9d82 sys/dev/dm/dm_target_snapshot.c
--- a/sys/dev/dm/dm_target_snapshot.c Sun Dec 08 10:37:19 2019 +0000
+++ b/sys/dev/dm/dm_target_snapshot.c Sun Dec 08 10:50:21 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_target_snapshot.c,v 1.27 2019/12/08 10:35:53 tkusumi Exp $ */
+/* $NetBSD: dm_target_snapshot.c,v 1.28 2019/12/08 10:50:21 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.27 2019/12/08 10:35:53 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_snapshot.c,v 1.28 2019/12/08 10:50:21 tkusumi Exp $");
/*
* 1. Suspend my_data to temporarily stop any I/O while the snapshot is being
@@ -103,6 +103,20 @@
int dm_target_snapshot_orig_destroy(dm_table_entry_t *);
int dm_target_snapshot_orig_upcall(dm_table_entry_t *, struct buf *);
+typedef struct target_snapshot_config {
+ dm_pdev_t *tsc_snap_dev;
+ /* cow dev is set only for persistent snapshot devices */
+ dm_pdev_t *tsc_cow_dev;
+
+ uint64_t tsc_chunk_size;
+ uint32_t tsc_persistent_dev;
+} dm_target_snapshot_config_t;
+
+typedef struct target_snapshot_origin_config {
+ dm_pdev_t *tsoc_real_dev;
+ /* list of snapshots ? */
+} dm_target_snapshot_origin_config_t;
+
#ifdef DM_TARGET_MODULE
/*
* Every target can be compiled directly to dm driver or as a
diff -r cf39d77ece36 -r a12f173d9d82 sys/dev/dm/dm_target_stripe.c
--- a/sys/dev/dm/dm_target_stripe.c Sun Dec 08 10:37:19 2019 +0000
+++ b/sys/dev/dm/dm_target_stripe.c Sun Dec 08 10:50:21 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_stripe.c,v 1.31 2019/12/08 04:41:02 tkusumi Exp $*/
+/*$NetBSD: dm_target_stripe.c,v 1.32 2019/12/08 10:50:21 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.31 2019/12/08 04:41:02 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_stripe.c,v 1.32 2019/12/08 10:50:21 tkusumi Exp $");
/*
* This file implements initial version of device-mapper stripe target.
@@ -43,6 +43,14 @@
#include "dm.h"
+typedef struct target_stripe_config {
+#define DM_STRIPE_DEV_OFFSET 2
+ struct target_linear_devs stripe_devs;
+ uint8_t stripe_num;
+ uint64_t stripe_chunksize;
+ size_t params_len;
+} dm_target_stripe_config_t;
+
#ifdef DM_TARGET_MODULE
/*
* Every target can be compiled directly to dm driver or as a
Home |
Main Index |
Thread Index |
Old Index