From 56c6f293c05aa52906200341e7f6384f8e48cc82 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sat, 3 Dec 2022 22:09:58 -0500 Subject: [PATCH] Remove duplicate statically allocated variable dsl_dataset_snapshot_sync_impl() declares `static zil_header_t zero_zil __maybe_unused;`, but this is also declared globally. This wastes memory. CodeQL's cpp/local-variable-hides-global-variable check caught this. Reviewed-by: Damian Szuberski Reviewed-by: Alexander Motin Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #14263 --- module/zfs/dsl_dataset.c | 1 - 1 file changed, 1 deletion(-) diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 4da4effca6..dcb9ad6ccc 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -1698,7 +1698,6 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dsl_dataset_phys_t *dsphys; uint64_t dsobj, crtxg; objset_t *mos = dp->dp_meta_objset; - static zil_header_t zero_zil __maybe_unused; objset_t *os __maybe_unused; ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock));