Skip to content

Commit

Permalink
Avoid unnecessary metaslab_check_free calling
Browse files Browse the repository at this point in the history
The metaslab_check_free() function only needs to be called in the
GANG|DEDUP|etc case because zio_free_sync() will internally call
metaslab_check_free().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Finix1979 <yancw@info2soft.com>
Closes openzfs#13977
  • Loading branch information
Finix1979 authored and snajpa committed Oct 22, 2022
1 parent 9adec90 commit f2b91d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp)
*/
if (BP_IS_EMBEDDED(bp))
return;
metaslab_check_free(spa, bp);

/*
* Frees that are for the currently-syncing txg, are not going to be
Expand All @@ -1223,6 +1222,7 @@ zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp)
txg != spa->spa_syncing_txg ||
(spa_sync_pass(spa) >= zfs_sync_pass_deferred_free &&
!spa_feature_is_active(spa, SPA_FEATURE_LOG_SPACEMAP))) {
metaslab_check_free(spa, bp);
bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp);
} else {
VERIFY3P(zio_free_sync(NULL, spa, txg, bp, 0), ==, NULL);
Expand Down

0 comments on commit f2b91d9

Please sign in to comment.