MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zio_free

Function zio_free

freebsd/contrib/openzfs/module/zfs/zio.c:1203–1237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1201}
1202
1203void
1204zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp)
1205{
1206
1207 (void) zfs_blkptr_verify(spa, bp, B_FALSE, BLK_VERIFY_HALT);
1208
1209 /*
1210 * The check for EMBEDDED is a performance optimization. We
1211 * process the free here (by ignoring it) rather than
1212 * putting it on the list and then processing it in zio_free_sync().
1213 */
1214 if (BP_IS_EMBEDDED(bp))
1215 return;
1216 metaslab_check_free(spa, bp);
1217
1218 /*
1219 * Frees that are for the currently-syncing txg, are not going to be
1220 * deferred, and which will not need to do a read (i.e. not GANG or
1221 * DEDUP), can be processed immediately. Otherwise, put them on the
1222 * in-memory list for later processing.
1223 *
1224 * Note that we only defer frees after zfs_sync_pass_deferred_free
1225 * when the log space map feature is disabled. [see relevant comment
1226 * in spa_sync_iterate_to_convergence()]
1227 */
1228 if (BP_IS_GANG(bp) ||
1229 BP_GET_DEDUP(bp) ||
1230 txg != spa->spa_syncing_txg ||
1231 (spa_sync_pass(spa) >= zfs_sync_pass_deferred_free &&
1232 !spa_feature_is_active(spa, SPA_FEATURE_LOG_SPACEMAP))) {
1233 bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp);
1234 } else {
1235 VERIFY3P(zio_free_sync(NULL, spa, txg, bp, 0), ==, NULL);
1236 }
1237}
1238
1239/*
1240 * To improve performance, this function may return NULL if we were able

Callers 12

dbuf_unoverrideFunction · 0.85
delete_blkptr_cbFunction · 0.85
unalloc_segFunction · 0.85
ddt_phys_freeFunction · 0.85
dsl_freeFunction · 0.85
zil_clear_log_blockFunction · 0.85
zil_free_log_blockFunction · 0.85
zil_free_log_recordFunction · 0.85
zil_createFunction · 0.85
zil_destroyFunction · 0.85
zil_syncFunction · 0.85

Calls 6

zfs_blkptr_verifyFunction · 0.85
metaslab_check_freeFunction · 0.85
spa_sync_passFunction · 0.85
spa_feature_is_activeFunction · 0.85
bplist_appendFunction · 0.85
zio_free_syncFunction · 0.85

Tested by

no test coverage detected