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: Rename dm specific atoi() to atoi64()
details: https://anonhg.NetBSD.org/src/rev/b71e14526f95
branches: trunk
changeset: 466225:b71e14526f95
user: tkusumi <tkusumi%NetBSD.org@localhost>
date: Sun Dec 15 16:14:27 2019 +0000
description:
dm: Rename dm specific atoi() to atoi64()
This is uint64_t version, not sys/lib/libsa/atoi.c.
diffstat:
sys/dev/dm/device-mapper.c | 22 +++++++++++++++++++++-
sys/dev/dm/dm.h | 8 ++++----
sys/dev/dm/dm_target_linear.c | 26 +++-----------------------
sys/dev/dm/dm_target_snapshot.c | 6 +++---
sys/dev/dm/dm_target_stripe.c | 10 +++++-----
5 files changed, 36 insertions(+), 36 deletions(-)
diffs (178 lines):
diff -r 4f395261dfa3 -r b71e14526f95 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c Sun Dec 15 16:00:52 2019 +0000
+++ b/sys/dev/dm/device-mapper.c Sun Dec 15 16:14:27 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device-mapper.c,v 1.54 2019/12/15 14:39:42 tkusumi Exp $ */
+/* $NetBSD: device-mapper.c,v 1.55 2019/12/15 16:14:27 tkusumi Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -700,3 +700,23 @@
disk_set_info(NULL, disk, "ESDI");
}
+
+/*
+ * Transform char s to uint64_t offset number.
+ */
+uint64_t
+atoi64(const char *s)
+{
+ uint64_t n;
+ n = 0;
+
+ while (*s != '\0') {
+ if (!isdigit(*s))
+ break;
+
+ n = (10 * n) + (*s - '0');
+ s++;
+ }
+
+ return n;
+}
diff -r 4f395261dfa3 -r b71e14526f95 sys/dev/dm/dm.h
--- a/sys/dev/dm/dm.h Sun Dec 15 16:00:52 2019 +0000
+++ b/sys/dev/dm/dm.h Sun Dec 15 16:14:27 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm.h,v 1.45 2019/12/15 10:12:45 tkusumi Exp $ */
+/* $NetBSD: dm.h,v 1.46 2019/12/15 16:14:27 tkusumi Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -210,6 +210,9 @@
/* device-mapper */
void dmgetproperties(struct disk *, dm_table_head_t *);
+/* Generic function used to convert char to string */
+uint64_t atoi64(const char *);
+
/* dm_ioctl.c */
int dm_dev_create_ioctl(prop_dictionary_t);
int dm_dev_list_ioctl(prop_dictionary_t);
@@ -253,9 +256,6 @@
int dm_target_linear_upcall(dm_table_entry_t *, struct buf *);
int dm_target_linear_secsize(dm_table_entry_t *, unsigned int *);
-/* Generic function used to convert char to string */
-uint64_t atoi(const char *);
-
/* dm_target_stripe.c */
int dm_target_stripe_init(dm_table_entry_t *, int, char **);
char *dm_target_stripe_table(void *);
diff -r 4f395261dfa3 -r b71e14526f95 sys/dev/dm/dm_target_linear.c
--- a/sys/dev/dm/dm_target_linear.c Sun Dec 15 16:00:52 2019 +0000
+++ b/sys/dev/dm/dm_target_linear.c Sun Dec 15 16:14:27 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_target_linear.c,v 1.31 2019/12/15 14:39:42 tkusumi Exp $ */
+/* $NetBSD: dm_target_linear.c,v 1.32 2019/12/15 16:14:27 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.31 2019/12/15 14:39:42 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_linear.c,v 1.32 2019/12/15 16:14:27 tkusumi Exp $");
/*
* This file implements initial version of device-mapper dklinear target.
@@ -75,7 +75,7 @@
tlc = kmem_alloc(sizeof(dm_target_linear_config_t), KM_SLEEP);
tlc->pdev = dmp;
- tlc->offset = atoi(argv[1]);
+ tlc->offset = atoi64(argv[1]);
table_en->target_config = tlc;
@@ -213,23 +213,3 @@
return 0;
}
-
-/*
- * Transform char s to uint64_t offset number.
- */
-uint64_t
-atoi(const char *s)
-{
- uint64_t n;
- n = 0;
-
- while (*s != '\0') {
- if (!isdigit(*s))
- break;
-
- n = (10 * n) + (*s - '0');
- s++;
- }
-
- return n;
-}
diff -r 4f395261dfa3 -r b71e14526f95 sys/dev/dm/dm_target_snapshot.c
--- a/sys/dev/dm/dm_target_snapshot.c Sun Dec 15 16:00:52 2019 +0000
+++ b/sys/dev/dm/dm_target_snapshot.c Sun Dec 15 16:14:27 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_target_snapshot.c,v 1.35 2019/12/15 14:39:42 tkusumi Exp $ */
+/* $NetBSD: dm_target_snapshot.c,v 1.36 2019/12/15 16:14:27 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.35 2019/12/15 14:39:42 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_snapshot.c,v 1.36 2019/12/15 16:14:27 tkusumi Exp $");
/*
* 1. Suspend my_data to temporarily stop any I/O while the snapshot is being
@@ -232,7 +232,7 @@
return ENOENT;
}
}
- tsc->tsc_chunk_size = atoi(argv[3]);
+ tsc->tsc_chunk_size = atoi64(argv[3]);
tsc->tsc_snap_dev = dmp_snap;
tsc->tsc_cow_dev = dmp_cow;
diff -r 4f395261dfa3 -r b71e14526f95 sys/dev/dm/dm_target_stripe.c
--- a/sys/dev/dm/dm_target_stripe.c Sun Dec 15 16:00:52 2019 +0000
+++ b/sys/dev/dm/dm_target_stripe.c Sun Dec 15 16:14:27 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target_stripe.c,v 1.38 2019/12/15 14:39:42 tkusumi Exp $*/
+/*$NetBSD: dm_target_stripe.c,v 1.39 2019/12/15 16:14:27 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.38 2019/12/15 14:39:42 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target_stripe.c,v 1.39 2019/12/15 16:14:27 tkusumi Exp $");
/*
* This file implements initial version of device-mapper stripe target.
@@ -156,8 +156,8 @@
TAILQ_INIT(&tsc->stripe_devs);
/* Save length of param string */
- tsc->stripe_chunksize = atoi(argv[1]);
- tsc->stripe_num = (uint8_t) atoi(argv[0]);
+ tsc->stripe_chunksize = atoi64(argv[1]);
+ tsc->stripe_num = (uint8_t) atoi64(argv[0]);
strpc = DM_STRIPE_DEV_OFFSET + (tsc->stripe_num * 2);
for (strpi = DM_STRIPE_DEV_OFFSET; strpi < strpc; strpi += 2) {
@@ -170,7 +170,7 @@
dm_target_stripe_fini(tsc);
return ENOENT;
}
- tlc->offset = atoi(argv[strpi+1]);
+ tlc->offset = atoi64(argv[strpi+1]);
/* Insert striping device to linked list. */
TAILQ_INSERT_TAIL(&tsc->stripe_devs, tlc, entries);
Home |
Main Index |
Thread Index |
Old Index