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

Function zil_clear_log_block

freebsd/contrib/openzfs/module/zfs/zil.c:434–454  ·  view source on GitHub ↗

ARGSUSED */

Source from the content-addressed store, hash-verified

432
433/* ARGSUSED */
434static int
435zil_clear_log_block(zilog_t *zilog, const blkptr_t *bp, void *tx,
436 uint64_t first_txg)
437{
438 ASSERT(!BP_IS_HOLE(bp));
439
440 /*
441 * As we call this function from the context of a rewind to a
442 * checkpoint, each ZIL block whose txg is later than the txg
443 * that we rewind to is invalid. Thus, we return -1 so
444 * zil_parse() doesn't attempt to read it.
445 */
446 if (bp->blk_birth >= first_txg)
447 return (-1);
448
449 if (zil_bp_tree_add(zilog, bp) != 0)
450 return (0);
451
452 zio_free(zilog->zl_spa, first_txg, bp);
453 return (0);
454}
455
456/* ARGSUSED */
457static int

Callers

nothing calls this directly

Calls 2

zil_bp_tree_addFunction · 0.85
zio_freeFunction · 0.85

Tested by

no test coverage detected