diff options
author | Matt Macy <mmacy@FreeBSD.org> | 2020-10-17 01:06:04 +0000 |
---|---|---|
committer | Matt Macy <mmacy@FreeBSD.org> | 2020-10-17 01:06:04 +0000 |
commit | 180f822596ecc49d3074dcc9dfea9628aae1d48d (patch) | |
tree | d9d18edc1bc35a2f11fd39f178451964c74b08f7 /sys/contrib/openzfs/module/zfs | |
parent | e7e2d659af5dca29378325d360be41903445933a (diff) | |
parent | 0be360124f8f108f73365e31448e7550f877f3ac (diff) | |
download | src-180f822596ecc49d3074dcc9dfea9628aae1d48d.tar.gz src-180f822596ecc49d3074dcc9dfea9628aae1d48d.zip |
Update OpenZFS to 2.0.0-rc3-gfc5966
- fix panic due to tqid overflow
- Improve libzfs_error_init messages
- Expose zfetch_max_idistance tunable
- Make dbufstat work on FreeBSD
- Fix EIO after resuming receive of new dataset over an existing one
Notes
Notes:
svn path=/head/; revision=366780
Diffstat (limited to 'sys/contrib/openzfs/module/zfs')
-rw-r--r-- | sys/contrib/openzfs/module/zfs/dmu_objset.c | 2 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/dmu_redact.c | 2 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/dmu_traverse.c | 6 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 5 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/dsl_scan.c | 10 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/pathname.c | 8 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/range_tree.c | 2 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/spa.c | 10 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/vdev.c | 18 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/vdev_label.c | 5 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/vdev_removal.c | 24 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/zfeature.c | 2 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 41 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/zfs_log.c | 12 | ||||
-rw-r--r-- | sys/contrib/openzfs/module/zfs/zil.c | 25 |
15 files changed, 94 insertions, 78 deletions
diff --git a/sys/contrib/openzfs/module/zfs/dmu_objset.c b/sys/contrib/openzfs/module/zfs/dmu_objset.c index b1590d7dba91..af5935e2374d 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_objset.c +++ b/sys/contrib/openzfs/module/zfs/dmu_objset.c @@ -2413,7 +2413,7 @@ dmu_objset_is_snapshot(objset_t *os) } int -dmu_snapshot_realname(objset_t *os, char *name, char *real, int maxlen, +dmu_snapshot_realname(objset_t *os, const char *name, char *real, int maxlen, boolean_t *conflict) { dsl_dataset_t *ds = os->os_dsl_dataset; diff --git a/sys/contrib/openzfs/module/zfs/dmu_redact.c b/sys/contrib/openzfs/module/zfs/dmu_redact.c index c53fba75cc51..225ec40537ec 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_redact.c +++ b/sys/contrib/openzfs/module/zfs/dmu_redact.c @@ -1062,9 +1062,9 @@ dmu_redact_snap(const char *snapname, nvlist_t *redactnvl, } } - VERIFY3P(nvlist_next_nvpair(redactnvl, pair), ==, NULL); if (err != 0) goto out; + VERIFY3P(nvlist_next_nvpair(redactnvl, pair), ==, NULL); boolean_t resuming = B_FALSE; zfs_bookmark_phys_t bookmark; diff --git a/sys/contrib/openzfs/module/zfs/dmu_traverse.c b/sys/contrib/openzfs/module/zfs/dmu_traverse.c index 83830fe39279..31db49dae68c 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_traverse.c +++ b/sys/contrib/openzfs/module/zfs/dmu_traverse.c @@ -73,7 +73,8 @@ static void prefetch_dnode_metadata(traverse_data_t *td, const dnode_phys_t *, uint64_t objset, uint64_t object); static int -traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +traverse_zil_block(zilog_t *zilog, const blkptr_t *bp, void *arg, + uint64_t claim_txg) { traverse_data_t *td = arg; zbookmark_phys_t zb; @@ -93,7 +94,8 @@ traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) } static int -traverse_zil_record(zilog_t *zilog, lr_t *lrc, void *arg, uint64_t claim_txg) +traverse_zil_record(zilog_t *zilog, const lr_t *lrc, void *arg, + uint64_t claim_txg) { traverse_data_t *td = arg; diff --git a/sys/contrib/openzfs/module/zfs/dmu_zfetch.c b/sys/contrib/openzfs/module/zfs/dmu_zfetch.c index 5935b5f995be..4d86863f30ea 100644 --- a/sys/contrib/openzfs/module/zfs/dmu_zfetch.c +++ b/sys/contrib/openzfs/module/zfs/dmu_zfetch.c @@ -377,7 +377,10 @@ ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, min_sec_reap, UINT, ZMOD_RW, "Min time before stream reclaim"); ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, max_distance, UINT, ZMOD_RW, - "Max bytes to prefetch per stream (default 8MB)"); + "Max bytes to prefetch per stream"); + +ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, max_idistance, UINT, ZMOD_RW, + "Max bytes to prefetch indirects for per stream"); ZFS_MODULE_PARAM(zfs_prefetch, zfetch_, array_rd_sz, ULONG, ZMOD_RW, "Number of bytes in a array_read"); diff --git a/sys/contrib/openzfs/module/zfs/dsl_scan.c b/sys/contrib/openzfs/module/zfs/dsl_scan.c index 0ebda2f77074..4704781bfa45 100644 --- a/sys/contrib/openzfs/module/zfs/dsl_scan.c +++ b/sys/contrib/openzfs/module/zfs/dsl_scan.c @@ -1375,7 +1375,8 @@ typedef struct zil_scan_arg { /* ARGSUSED */ static int -dsl_scan_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +dsl_scan_zil_block(zilog_t *zilog, const blkptr_t *bp, void *arg, + uint64_t claim_txg) { zil_scan_arg_t *zsa = arg; dsl_pool_t *dp = zsa->zsa_dp; @@ -1405,15 +1406,16 @@ dsl_scan_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) /* ARGSUSED */ static int -dsl_scan_zil_record(zilog_t *zilog, lr_t *lrc, void *arg, uint64_t claim_txg) +dsl_scan_zil_record(zilog_t *zilog, const lr_t *lrc, void *arg, + uint64_t claim_txg) { if (lrc->lrc_txtype == TX_WRITE) { zil_scan_arg_t *zsa = arg; dsl_pool_t *dp = zsa->zsa_dp; dsl_scan_t *scn = dp->dp_scan; zil_header_t *zh = zsa->zsa_zh; - lr_write_t *lr = (lr_write_t *)lrc; - blkptr_t *bp = &lr->lr_blkptr; + const lr_write_t *lr = (const lr_write_t *)lrc; + const blkptr_t *bp = &lr->lr_blkptr; zbookmark_phys_t zb; ASSERT(!BP_IS_REDACTED(bp)); diff --git a/sys/contrib/openzfs/module/zfs/pathname.c b/sys/contrib/openzfs/module/zfs/pathname.c index 4766762f37d1..84ab7b7e1111 100644 --- a/sys/contrib/openzfs/module/zfs/pathname.c +++ b/sys/contrib/openzfs/module/zfs/pathname.c @@ -73,10 +73,6 @@ pn_alloc_sz(struct pathname *pnp, size_t sz) { pnp->pn_buf = kmem_alloc(sz, KM_SLEEP); pnp->pn_bufsize = sz; -#if 0 /* unused in ZoL */ - pnp->pn_path = pnp->pn_buf; - pnp->pn_pathlen = 0; -#endif } /* @@ -89,8 +85,4 @@ pn_free(struct pathname *pnp) kmem_free(pnp->pn_buf, pnp->pn_bufsize); pnp->pn_buf = NULL; pnp->pn_bufsize = 0; -#if 0 /* unused in ZoL */ - pnp->pn_path = NULL; - pnp->pn_pathlen = 0; -#endif } diff --git a/sys/contrib/openzfs/module/zfs/range_tree.c b/sys/contrib/openzfs/module/zfs/range_tree.c index 2ce0139c9137..5219fd079b73 100644 --- a/sys/contrib/openzfs/module/zfs/range_tree.c +++ b/sys/contrib/openzfs/module/zfs/range_tree.c @@ -314,7 +314,6 @@ range_tree_add_impl(void *arg, uint64_t start, uint64_t size, uint64_t fill) return; } - zfs_btree_remove(&rt->rt_root, rs); if (rt->rt_ops != NULL && rt->rt_ops->rtop_remove != NULL) rt->rt_ops->rtop_remove(rt, rs, rt->rt_arg); @@ -326,6 +325,7 @@ range_tree_add_impl(void *arg, uint64_t start, uint64_t size, uint64_t fill) end = MAX(end, rend); size = end - start; + zfs_btree_remove(&rt->rt_root, rs); range_tree_add_impl(rt, start, size, fill); return; } diff --git a/sys/contrib/openzfs/module/zfs/spa.c b/sys/contrib/openzfs/module/zfs/spa.c index 532f04b91ca1..9d1d4e0cca64 100644 --- a/sys/contrib/openzfs/module/zfs/spa.c +++ b/sys/contrib/openzfs/module/zfs/spa.c @@ -1260,7 +1260,7 @@ spa_activate(spa_t *spa, spa_mode_t mode) /* * This taskq is used to perform zvol-minor-related tasks * asynchronously. This has several advantages, including easy - * resolution of various deadlocks (zfsonlinux bug #3681). + * resolution of various deadlocks. * * The taskq must be single threaded to ensure tasks are always * processed in the order in which they were dispatched. @@ -6225,7 +6225,7 @@ spa_tryimport(nvlist_t *tryconfig) * we don't sync the labels or remove the configuration cache. */ static int -spa_export_common(char *pool, int new_state, nvlist_t **oldconfig, +spa_export_common(const char *pool, int new_state, nvlist_t **oldconfig, boolean_t force, boolean_t hardforce) { spa_t *spa; @@ -6369,7 +6369,7 @@ export_spa: * Destroy a storage pool. */ int -spa_destroy(char *pool) +spa_destroy(const char *pool) { return (spa_export_common(pool, POOL_STATE_DESTROYED, NULL, B_FALSE, B_FALSE)); @@ -6379,7 +6379,7 @@ spa_destroy(char *pool) * Export a storage pool. */ int -spa_export(char *pool, nvlist_t **oldconfig, boolean_t force, +spa_export(const char *pool, nvlist_t **oldconfig, boolean_t force, boolean_t hardforce) { return (spa_export_common(pool, POOL_STATE_EXPORTED, oldconfig, @@ -6391,7 +6391,7 @@ spa_export(char *pool, nvlist_t **oldconfig, boolean_t force, * from the namespace in any way. */ int -spa_reset(char *pool) +spa_reset(const char *pool) { return (spa_export_common(pool, POOL_STATE_UNINITIALIZED, NULL, B_FALSE, B_FALSE)); diff --git a/sys/contrib/openzfs/module/zfs/vdev.c b/sys/contrib/openzfs/module/zfs/vdev.c index a94101485c94..6af61cdcd9bf 100644 --- a/sys/contrib/openzfs/module/zfs/vdev.c +++ b/sys/contrib/openzfs/module/zfs/vdev.c @@ -1286,9 +1286,9 @@ vdev_metaslab_group_create(vdev_t *vd) spa->spa_alloc_count); /* - * The spa ashift values currently only reflect the - * general vdev classes. Class destination is late - * binding so ashift checking had to wait until now + * The spa ashift min/max only apply for the normal metaslab + * class. Class destination is late binding so ashift boundry + * setting had to wait until now. */ if (vd->vdev_top == vd && vd->vdev_ashift != 0 && mc == spa_normal_class(spa) && vd->vdev_aux == NULL) { @@ -1953,18 +1953,6 @@ vdev_open(vdev_t *vd) } /* - * Track the min and max ashift values for normal data devices. - */ - if (vd->vdev_top == vd && vd->vdev_ashift != 0 && - vd->vdev_alloc_bias == VDEV_BIAS_NONE && - vd->vdev_islog == 0 && vd->vdev_aux == NULL) { - if (vd->vdev_ashift > spa->spa_max_ashift) - spa->spa_max_ashift = vd->vdev_ashift; - if (vd->vdev_ashift < spa->spa_min_ashift) - spa->spa_min_ashift = vd->vdev_ashift; - } - - /* * If this is a leaf vdev, assess whether a resilver is needed. * But don't do this if we are doing a reopen for a scrub, since * this would just restart the scrub we are already doing. diff --git a/sys/contrib/openzfs/module/zfs/vdev_label.c b/sys/contrib/openzfs/module/zfs/vdev_label.c index 7fab7d0d7950..d063b77ea836 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_label.c +++ b/sys/contrib/openzfs/module/zfs/vdev_label.c @@ -613,7 +613,8 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats, * as a single mapping. */ for (int i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) { - if (1ULL << (i + 1) < vdev_removal_max_span) { + if (i + 1 < highbit64(vdev_removal_max_span) + - 1) { to_alloc += vd->vdev_mg->mg_histogram[i] << (i + 1); @@ -1433,7 +1434,7 @@ vdev_uberblock_compare(const uberblock_t *ub1, const uberblock_t *ub2) /* * If MMP_VALID(ub) && MMP_SEQ_VALID(ub) then the host has an MMP-aware - * ZFS, e.g. zfsonlinux >= 0.7. + * ZFS, e.g. OpenZFS >= 0.7. * * If one ub has MMP and the other does not, they were written by * different hosts, which matters for MMP. So we treat no MMP/no SEQ as diff --git a/sys/contrib/openzfs/module/zfs/vdev_removal.c b/sys/contrib/openzfs/module/zfs/vdev_removal.c index fdeca7ab3418..ed7d1d4b3030 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_removal.c +++ b/sys/contrib/openzfs/module/zfs/vdev_removal.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2019 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>. All rights reserved. */ @@ -2031,6 +2031,15 @@ spa_vdev_remove_top_check(vdev_t *vd) } /* + * A removed special/dedup vdev must have same ashift as normal class. + */ + ASSERT(!vd->vdev_islog); + if (vd->vdev_alloc_bias != VDEV_BIAS_NONE && + vd->vdev_ashift != spa->spa_max_ashift) { + return (SET_ERROR(EINVAL)); + } + + /* * All vdevs in normal class must have the same ashift * and not be raidz. */ @@ -2038,7 +2047,18 @@ spa_vdev_remove_top_check(vdev_t *vd) int num_indirect = 0; for (uint64_t id = 0; id < rvd->vdev_children; id++) { vdev_t *cvd = rvd->vdev_child[id]; - if (cvd->vdev_ashift != 0 && !cvd->vdev_islog) + + /* + * A removed special/dedup vdev must have the same ashift + * across all vdevs in its class. + */ + if (vd->vdev_alloc_bias != VDEV_BIAS_NONE && + cvd->vdev_alloc_bias == vd->vdev_alloc_bias && + cvd->vdev_ashift != vd->vdev_ashift) { + return (SET_ERROR(EINVAL)); + } + if (cvd->vdev_ashift != 0 && + cvd->vdev_alloc_bias == VDEV_BIAS_NONE) ASSERT3U(cvd->vdev_ashift, ==, spa->spa_max_ashift); if (cvd->vdev_ops == &vdev_indirect_ops) num_indirect++; diff --git a/sys/contrib/openzfs/module/zfs/zfeature.c b/sys/contrib/openzfs/module/zfs/zfeature.c index 3757443a5a68..9d16fff81d0a 100644 --- a/sys/contrib/openzfs/module/zfs/zfeature.c +++ b/sys/contrib/openzfs/module/zfs/zfeature.c @@ -203,7 +203,7 @@ spa_features_check(spa_t *spa, boolean_t for_write, supported = B_FALSE; if (NULL != unsup_feat) { - char *desc = ""; + const char *desc = ""; if (zap_lookup(os, spa->spa_feat_desc_obj, za->za_name, 1, MAXPATHLEN, buf) == 0) diff --git a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c index eff66b32fcb1..94cd1a3dc834 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c +++ b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c @@ -270,7 +270,7 @@ static int zfs_ioc_userspace_upgrade(zfs_cmd_t *zc); static int zfs_ioc_id_quota_upgrade(zfs_cmd_t *zc); static int zfs_check_settable(const char *name, nvpair_t *property, cred_t *cr); -static int zfs_check_clearable(char *dataset, nvlist_t *props, +static int zfs_check_clearable(const char *dataset, nvlist_t *props, nvlist_t **errors); static int zfs_fill_zplprops_root(uint64_t, nvlist_t *, nvlist_t *, boolean_t *); @@ -498,7 +498,7 @@ zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr) * Returns 0 for success, non-zero for access and other errors. */ static int -zfs_set_slabel_policy(const char *name, char *strval, cred_t *cr) +zfs_set_slabel_policy(const char *name, const char *strval, cred_t *cr) { #ifdef HAVE_MLSLABEL char ds_hexsl[MAXNAMELEN]; @@ -553,7 +553,7 @@ zfs_set_slabel_policy(const char *name, char *strval, cred_t *cr) */ if (strcasecmp(ds_hexsl, ZFS_MLSLABEL_DEFAULT) != 0) { objset_t *os; - static char *setsl_tag = "setsl_tag"; + static const char *setsl_tag = "setsl_tag"; /* * Try to own the dataset; abort if there is any error, @@ -680,7 +680,7 @@ zfs_secpolicy_send(zfs_cmd_t *zc, nvlist_t *innvl, cred_t *cr) { dsl_pool_t *dp; dsl_dataset_t *ds; - char *cp; + const char *cp; int error; /* @@ -1443,7 +1443,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) nvlist_t *rootprops = NULL; nvlist_t *zplprops = NULL; dsl_crypto_params_t *dcp = NULL; - char *spa_name = zc->zc_name; + const char *spa_name = zc->zc_name; boolean_t unload_wkey = B_TRUE; if ((error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, @@ -1997,7 +1997,7 @@ static int zfs_ioc_vdev_setpath(zfs_cmd_t *zc) { spa_t *spa; - char *path = zc->zc_value; + const char *path = zc->zc_value; uint64_t guid = zc->zc_guid; int error; @@ -2014,7 +2014,7 @@ static int zfs_ioc_vdev_setfru(zfs_cmd_t *zc) { spa_t *spa; - char *fru = zc->zc_value; + const char *fru = zc->zc_value; uint64_t guid = zc->zc_guid; int error; @@ -2351,8 +2351,7 @@ zfs_prop_set_userquota(const char *dsname, nvpair_t *pair) const char *propname = nvpair_name(pair); uint64_t *valary; unsigned int vallen; - const char *domain; - char *dash; + const char *dash, *domain; zfs_userquota_prop_t type; uint64_t rid; uint64_t quota; @@ -2405,7 +2404,7 @@ zfs_prop_set_special(const char *dsname, zprop_source_t source, const char *propname = nvpair_name(pair); zfs_prop_t prop = zfs_name_to_prop(propname); uint64_t intval = 0; - char *strval = NULL; + const char *strval = NULL; int err = -1; if (prop == ZPROP_INVAL) { @@ -2531,7 +2530,7 @@ zfs_set_prop_nvlist(const char *dsname, zprop_source_t source, nvlist_t *nvl, nvpair_t *propval; int rv = 0; uint64_t intval; - char *strval; + const char *strval; nvlist_t *genericnvl = fnvlist_alloc(); nvlist_t *retrynvl = fnvlist_alloc(); @@ -3349,7 +3348,7 @@ zfs_ioc_clone(const char *fsname, nvlist_t *innvl, nvlist_t *outnvl) { int error = 0; nvlist_t *nvprops = NULL; - char *origin_name; + const char *origin_name; origin_name = fnvlist_lookup_string(innvl, "origin"); (void) nvlist_lookup_nvlist(innvl, "props", &nvprops); @@ -3475,10 +3474,10 @@ static const zfs_ioc_key_t zfs_keys_log_history[] = { static int zfs_ioc_log_history(const char *unused, nvlist_t *innvl, nvlist_t *outnvl) { - char *message; + const char *message; + char *poolname; spa_t *spa; int error; - char *poolname; /* * The poolname in the ioctl is not set, we get it from the TSD, @@ -3574,7 +3573,7 @@ zfs_unmount_snap(const char *snapname) if (strchr(snapname, '@') == NULL) return; - (void) zfsctl_snapshot_unmount((char *)snapname, MNT_FORCE); + (void) zfsctl_snapshot_unmount(snapname, MNT_FORCE); } /* ARGSUSED */ @@ -4617,7 +4616,7 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr) * pointed at by errlist is NULL. */ static int -zfs_check_clearable(char *dataset, nvlist_t *props, nvlist_t **errlist) +zfs_check_clearable(const char *dataset, nvlist_t *props, nvlist_t **errlist) { zfs_cmd_t *zc; nvpair_t *pair, *next_pair; @@ -6429,8 +6428,10 @@ send_space_sum(objset_t *os, void *buf, int len, void *arg) * presence indicates DRR_WRITE_EMBEDDED records are permitted * (optional) "compressok" -> (value ignored) * presence indicates compressed DRR_WRITE records are permitted - * (optional) "rawok" -> (value ignored) + * (optional) "rawok" -> (value ignored) * presence indicates raw encrypted records should be used. + * (optional) "resume_object" and "resume_offset" -> (uint64) + * if present, resume send stream from specified object and offset. * (optional) "fd" -> file descriptor to use as a cookie for progress * tracking (int32) * } @@ -6448,9 +6449,9 @@ static const zfs_ioc_key_t zfs_keys_send_space[] = { {"rawok", DATA_TYPE_BOOLEAN, ZK_OPTIONAL}, {"fd", DATA_TYPE_INT32, ZK_OPTIONAL}, {"redactbook", DATA_TYPE_STRING, ZK_OPTIONAL}, - {"resumeobj", DATA_TYPE_UINT64, ZK_OPTIONAL}, - {"resumeoff", DATA_TYPE_UINT64, ZK_OPTIONAL}, - {"bytes", DATA_TYPE_UINT64, ZK_OPTIONAL}, + {"resume_object", DATA_TYPE_UINT64, ZK_OPTIONAL}, + {"resume_offset", DATA_TYPE_UINT64, ZK_OPTIONAL}, + {"bytes", DATA_TYPE_UINT64, ZK_OPTIONAL}, }; static int diff --git a/sys/contrib/openzfs/module/zfs/zfs_log.c b/sys/contrib/openzfs/module/zfs/zfs_log.c index fb44007fefc3..4bb529f78838 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_log.c +++ b/sys/contrib/openzfs/module/zfs/zfs_log.c @@ -299,7 +299,7 @@ zfs_xattr_owner_unlinked(znode_t *zp) */ void zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, znode_t *zp, char *name, vsecattr_t *vsecp, + znode_t *dzp, znode_t *zp, const char *name, vsecattr_t *vsecp, zfs_fuid_info_t *fuidp, vattr_t *vap) { itx_t *itx; @@ -413,7 +413,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, char *name, uint64_t foid, boolean_t unlinked) + znode_t *dzp, const char *name, uint64_t foid, boolean_t unlinked) { itx_t *itx; lr_remove_t *lr; @@ -448,7 +448,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, znode_t *zp, char *name) + znode_t *dzp, znode_t *zp, const char *name) { itx_t *itx; lr_link_t *lr; @@ -471,7 +471,7 @@ zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, */ void zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, znode_t *zp, char *name, char *link) + znode_t *dzp, znode_t *zp, const char *name, const char *link) { itx_t *itx; lr_create_t *lr; @@ -502,8 +502,8 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, * Handles TX_RENAME transactions. */ void -zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *sdzp, char *sname, znode_t *tdzp, char *dname, znode_t *szp) +zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, znode_t *sdzp, + const char *sname, znode_t *tdzp, const char *dname, znode_t *szp) { itx_t *itx; lr_rename_t *lr; diff --git a/sys/contrib/openzfs/module/zfs/zil.c b/sys/contrib/openzfs/module/zfs/zil.c index 9dc20ba14f37..632fef29bff4 100644 --- a/sys/contrib/openzfs/module/zfs/zil.c +++ b/sys/contrib/openzfs/module/zfs/zil.c @@ -432,7 +432,8 @@ done: /* ARGSUSED */ static int -zil_clear_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) +zil_clear_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, + uint64_t first_txg) { ASSERT(!BP_IS_HOLE(bp)); @@ -454,13 +455,15 @@ zil_clear_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) /* ARGSUSED */ static int -zil_noop_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t first_txg) +zil_noop_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, + uint64_t first_txg) { return (0); } static int -zil_claim_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) +zil_claim_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, + uint64_t first_txg) { /* * Claim log block if not already committed and not already claimed. @@ -476,7 +479,8 @@ zil_claim_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) } static int -zil_claim_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t first_txg) +zil_claim_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, + uint64_t first_txg) { lr_write_t *lr = (lr_write_t *)lrc; int error; @@ -503,7 +507,8 @@ zil_claim_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t first_txg) /* ARGSUSED */ static int -zil_free_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t claim_txg) +zil_free_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx, + uint64_t claim_txg) { zio_free(zilog->zl_spa, dmu_tx_get_txg(tx), bp); @@ -511,7 +516,8 @@ zil_free_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t claim_txg) } static int -zil_free_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t claim_txg) +zil_free_log_record(zilog_t *zilog, const lr_t *lrc, void *tx, + uint64_t claim_txg) { lr_write_t *lr = (lr_write_t *)lrc; blkptr_t *bp = &lr->lr_blkptr; @@ -3471,7 +3477,7 @@ typedef struct zil_replay_arg { } zil_replay_arg_t; static int -zil_replay_error(zilog_t *zilog, lr_t *lr, int error) +zil_replay_error(zilog_t *zilog, const lr_t *lr, int error) { char name[ZFS_MAX_DATASET_NAME_LEN]; @@ -3489,7 +3495,8 @@ zil_replay_error(zilog_t *zilog, lr_t *lr, int error) } static int -zil_replay_log_record(zilog_t *zilog, lr_t *lr, void *zra, uint64_t claim_txg) +zil_replay_log_record(zilog_t *zilog, const lr_t *lr, void *zra, + uint64_t claim_txg) { zil_replay_arg_t *zr = zra; const zil_header_t *zh = zilog->zl_header; @@ -3572,7 +3579,7 @@ zil_replay_log_record(zilog_t *zilog, lr_t *lr, void *zra, uint64_t claim_txg) /* ARGSUSED */ static int -zil_incr_blks(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg) +zil_incr_blks(zilog_t *zilog, const blkptr_t *bp, void *arg, uint64_t claim_txg) { zilog->zl_replay_blks++; |