From d8fdfc2d657b2926cf8d7ceb9675ff0df7265858 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 8 Nov 2017 09:09:45 -0800 Subject: [PATCH] OpenZFS 8607 - variable set but not used Reviewed by: Yuri Pankov Reviewed by: Igor Kozhukhov Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Authored by: Toomas Soome Reviewed-by: George Melikov Reviewed-by: Giuseppe Di Natale Ported-by: Brian Behlendorf OpenZFS-issue: https://www.illumos.org/issues/8607 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/b852c2f5 Closes #6842 --- module/zfs/dsl_pool.c | 14 ++++++++------ module/zfs/zfs_ioctl.c | 10 +++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c index 6f435dcc2..43fd90861 100644 --- a/module/zfs/dsl_pool.c +++ b/module/zfs/dsl_pool.c @@ -402,7 +402,6 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, dsl_crypto_params_t *dcp, int err; dsl_pool_t *dp = dsl_pool_open_impl(spa, txg); dmu_tx_t *tx = dmu_tx_create_assigned(dp, txg); - objset_t *os; dsl_dataset_t *ds; uint64_t obj; @@ -465,12 +464,15 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, dsl_crypto_params_t *dcp, /* create the root objset */ VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, &ds)); - rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); - VERIFY(NULL != (os = dmu_objset_create_impl(dp->dp_spa, ds, - dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx))); - rrw_exit(&ds->ds_bp_rwlock, FTAG); #ifdef _KERNEL - zfs_create_fs(os, kcred, zplprops, tx); + { + objset_t *os; + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); + os = dmu_objset_create_impl(dp->dp_spa, ds, + dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); + zfs_create_fs(os, kcred, zplprops, tx); + } #endif dsl_dataset_rele(ds, FTAG); diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index 1d94f9ca0..9bd9b58ba 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -5911,10 +5911,6 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) dsl_dataset_t *tosnap; int error; char *fromname; - /* LINTED E_FUNC_SET_NOT_USED */ - boolean_t largeblockok; - /* LINTED E_FUNC_SET_NOT_USED */ - boolean_t embedok; boolean_t compressok; boolean_t rawok; uint64_t space; @@ -5929,8 +5925,6 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) return (error); } - largeblockok = nvlist_exists(innvl, "largeblockok"); - embedok = nvlist_exists(innvl, "embedok"); compressok = nvlist_exists(innvl, "compressok"); rawok = nvlist_exists(innvl, "rawok"); @@ -5973,7 +5967,9 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) goto out; } } else { - // If estimating the size of a full send, use dmu_send_estimate + /* + * If estimating the size of a full send, use dmu_send_estimate. + */ error = dmu_send_estimate(tosnap, NULL, compressok || rawok, &space); } -- 2.40.0