HomeFreeBSD

Remove duplicate statically allocated variable

Description

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 <szuberskidamian@gmail.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14263

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Dec 4 2022, 3:09 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Dec 8 2022, 9:52 PM
Parents
rGaaa9a6700f98: Cleanup: zhack should not declare function prototypes in main()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG56c6f293c05a: Remove duplicate statically allocated variable (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Dec 8 2022, 9:52 PM