aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorYuri Pankov <[email protected]>2017-06-12 20:16:28 -0700
committerBrian Behlendorf <[email protected]>2017-07-08 20:35:35 -0700
commite19572e4cc0b8df95ebf60053029e454592a92d4 (patch)
tree7e4b6ec6a9c03afb2d1aa252c9cfc332b07593cf /module
parentb24827ac1e327f763a8dd4ed60c44c2a5d918b42 (diff)
OpenZFS 5428 - provide fts(), reallocarray(), and strtonum()
Authored by: Yuri Pankov <[email protected]> Reviewed by: Robert Mustacchi <[email protected]> Approved by: Joshua M. Clulow <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Brian Behlendorf <[email protected]> Porting Notes: * All hunks unrelated to ZFS were dropped. OpenZFS-issue: https://www.illumos.org/issues/5428 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/4585130 Closes #6326
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dsl_deadlist.c8
-rw-r--r--module/zfs/dsl_scan.c2
-rw-r--r--module/zfs/dsl_userhold.c2
-rw-r--r--module/zfs/spa_errlog.c8
-rw-r--r--module/zfs/spa_misc.c2
-rw-r--r--module/zfs/zfs_vfsops.c2
6 files changed, 11 insertions, 13 deletions
diff --git a/module/zfs/dsl_deadlist.c b/module/zfs/dsl_deadlist.c
index 258e626fa..0be0d7420 100644
--- a/module/zfs/dsl_deadlist.c
+++ b/module/zfs/dsl_deadlist.c
@@ -78,10 +78,8 @@ dsl_deadlist_load_tree(dsl_deadlist_t *dl)
for (zap_cursor_init(&zc, dl->dl_os, dl->dl_object);
zap_cursor_retrieve(&zc, &za) == 0;
zap_cursor_advance(&zc)) {
- dsl_deadlist_entry_t *dle;
-
- dle = kmem_alloc(sizeof (*dle), KM_SLEEP);
- dle->dle_mintxg = strtonum(za.za_name, NULL);
+ dsl_deadlist_entry_t *dle = kmem_alloc(sizeof (*dle), KM_SLEEP);
+ dle->dle_mintxg = zfs_strtonum(za.za_name, NULL);
VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os,
za.za_first_integer));
avl_add(&dl->dl_tree, dle);
@@ -494,7 +492,7 @@ dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, dmu_tx_t *tx)
for (zap_cursor_init(&zc, dl->dl_os, obj);
zap_cursor_retrieve(&zc, &za) == 0;
zap_cursor_advance(&zc)) {
- uint64_t mintxg = strtonum(za.za_name, NULL);
+ uint64_t mintxg = zfs_strtonum(za.za_name, NULL);
dsl_deadlist_insert_bpobj(dl, za.za_first_integer, mintxg, tx);
VERIFY3U(0, ==, zap_remove_int(dl->dl_os, obj, mintxg, tx));
}
diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c
index ccf3cee12..369ccd8a7 100644
--- a/module/zfs/dsl_scan.c
+++ b/module/zfs/dsl_scan.c
@@ -1512,7 +1512,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t *tx)
dsl_dataset_t *ds;
uint64_t dsobj;
- dsobj = strtonum(za->za_name, NULL);
+ dsobj = zfs_strtonum(za->za_name, NULL);
VERIFY3U(0, ==, zap_remove_int(dp->dp_meta_objset,
scn->scn_phys.scn_queue_obj, dsobj, tx));
diff --git a/module/zfs/dsl_userhold.c b/module/zfs/dsl_userhold.c
index a6d1aa937..583fbfe47 100644
--- a/module/zfs/dsl_userhold.c
+++ b/module/zfs/dsl_userhold.c
@@ -342,7 +342,7 @@ static int
dsl_dataset_hold_obj_string(dsl_pool_t *dp, const char *dsobj, void *tag,
dsl_dataset_t **dsp)
{
- return (dsl_dataset_hold_obj(dp, strtonum(dsobj, NULL), tag, dsp));
+ return (dsl_dataset_hold_obj(dp, zfs_strtonum(dsobj, NULL), tag, dsp));
}
static int
diff --git a/module/zfs/spa_errlog.c b/module/zfs/spa_errlog.c
index 925e2af60..3c8aa543b 100644
--- a/module/zfs/spa_errlog.c
+++ b/module/zfs/spa_errlog.c
@@ -73,13 +73,13 @@ bookmark_to_name(zbookmark_phys_t *zb, char *buf, size_t len)
static void
name_to_bookmark(char *buf, zbookmark_phys_t *zb)
{
- zb->zb_objset = strtonum(buf, &buf);
+ zb->zb_objset = zfs_strtonum(buf, &buf);
ASSERT(*buf == ':');
- zb->zb_object = strtonum(buf + 1, &buf);
+ zb->zb_object = zfs_strtonum(buf + 1, &buf);
ASSERT(*buf == ':');
- zb->zb_level = (int)strtonum(buf + 1, &buf);
+ zb->zb_level = (int)zfs_strtonum(buf + 1, &buf);
ASSERT(*buf == ':');
- zb->zb_blkid = strtonum(buf + 1, &buf);
+ zb->zb_blkid = zfs_strtonum(buf + 1, &buf);
ASSERT(*buf == '\0');
}
#endif
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
index 8e23bcf45..09e5067a5 100644
--- a/module/zfs/spa_misc.c
+++ b/module/zfs/spa_misc.c
@@ -1465,7 +1465,7 @@ zfs_panic_recover(const char *fmt, ...)
* lowercase hexadecimal numbers that don't overflow.
*/
uint64_t
-strtonum(const char *str, char **nptr)
+zfs_strtonum(const char *str, char **nptr)
{
uint64_t val = 0;
char c;
diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c
index 6d4761607..0e3f37781 100644
--- a/module/zfs/zfs_vfsops.c
+++ b/module/zfs/zfs_vfsops.c
@@ -604,7 +604,7 @@ fuidstr_to_sid(zfsvfs_t *zfsvfs, const char *fuidstr,
uint64_t fuid;
const char *domain;
- fuid = strtonum(fuidstr, NULL);
+ fuid = zfs_strtonum(fuidstr, NULL);
domain = zfs_fuid_find_by_idx(zfsvfs, FUID_INDEX(fuid));
if (domain)