spa_activity_check: narrow scope of MMP vars

They aren't used outside these very small blocks, and their initial
values are never used at all.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #17551
This commit is contained in:
Rob Norris 2025-06-27 12:54:47 +10:00 committed by Tony Hutter
parent a1d839eddd
commit 8010a8a3ca

View File

@ -3829,20 +3829,17 @@ out:
* ZPOOL_CONFIG_MMP_HOSTID - hostid from the active pool * ZPOOL_CONFIG_MMP_HOSTID - hostid from the active pool
*/ */
if (error == EREMOTEIO) { if (error == EREMOTEIO) {
const char *hostname = "<unknown>";
uint64_t hostid = 0;
if (mmp_label) { if (mmp_label) {
if (nvlist_exists(mmp_label, ZPOOL_CONFIG_HOSTNAME)) { if (nvlist_exists(mmp_label, ZPOOL_CONFIG_HOSTNAME)) {
hostname = fnvlist_lookup_string(mmp_label, const char *hostname = fnvlist_lookup_string(
ZPOOL_CONFIG_HOSTNAME); mmp_label, ZPOOL_CONFIG_HOSTNAME);
fnvlist_add_string(spa->spa_load_info, fnvlist_add_string(spa->spa_load_info,
ZPOOL_CONFIG_MMP_HOSTNAME, hostname); ZPOOL_CONFIG_MMP_HOSTNAME, hostname);
} }
if (nvlist_exists(mmp_label, ZPOOL_CONFIG_HOSTID)) { if (nvlist_exists(mmp_label, ZPOOL_CONFIG_HOSTID)) {
hostid = fnvlist_lookup_uint64(mmp_label, uint64_t hostid = fnvlist_lookup_uint64(
ZPOOL_CONFIG_HOSTID); mmp_label, ZPOOL_CONFIG_HOSTID);
fnvlist_add_uint64(spa->spa_load_info, fnvlist_add_uint64(spa->spa_load_info,
ZPOOL_CONFIG_MMP_HOSTID, hostid); ZPOOL_CONFIG_MMP_HOSTID, hostid);
} }