]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Avoid extra snprintf() in dsl_deadlist_merge().
authorAlexander Motin <mav@FreeBSD.org>
Fri, 14 Jul 2023 23:11:46 +0000 (19:11 -0400)
committerGitHub <noreply@github.com>
Fri, 14 Jul 2023 23:11:46 +0000 (16:11 -0700)
Since we are already iterating the ZAP, we have exact string key to
remove, we do not need to call zap_remove_int() with the int key we
just converted, we can call zap_remove() for the original string.

This should make no functional change, only a micro-optimization.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15056

module/zfs/dsl_deadlist.c

index 181efd8ed69c96ba6c0a66da7791c484df195eae..47c234f76c40dfb7dbf391c860db2158ce7f2b56 100644 (file)
@@ -892,9 +892,9 @@ dsl_deadlist_merge(dsl_deadlist_t *dl, uint64_t obj, dmu_tx_t *tx)
        for (zap_cursor_init(&zc, dl->dl_os, obj);
            (error = zap_cursor_retrieve(&zc, za)) == 0;
            zap_cursor_advance(&zc)) {
-               uint64_t mintxg = zfs_strtonum(za->za_name, NULL);
-               dsl_deadlist_insert_bpobj(dl, za->za_first_integer, mintxg, tx);
-               VERIFY0(zap_remove_int(dl->dl_os, obj, mintxg, tx));
+               dsl_deadlist_insert_bpobj(dl, za->za_first_integer,
+                   zfs_strtonum(za->za_name, NULL), tx);
+               VERIFY0(zap_remove(dl->dl_os, obj, za->za_name, tx));
                if (perror == 0) {
                        dsl_deadlist_prefetch_bpobj(dl, pza->za_first_integer,
                            zfs_strtonum(pza->za_name, NULL));