bt_journal_hook Interface

interface

Optional pre-write journal hook. Invoked by every page write before the page is overwritten, so a transaction layer can capture an undo image. offset is the page's 1-based byte position in the file. For an in-place overwrite is_new is .false. and old_bytes is the page's current page_size-byte pre-image; for a freshly allocated page is_new is .true., old_bytes is empty, and the layer should record the file's pre-growth length instead. A non-zero stat aborts the write, so a journalling failure never lets an un-recorded overwrite through. ctx is the caller's opaque context, threaded unchanged.


public subroutine bt_journal_hook(ctx, offset, old_bytes, is_new, stat)

Arguments

Type IntentOptional Attributes Name
class(*), intent(in) :: ctx

Opaque caller context

integer(kind=int64), intent(in) :: offset

1-based byte position of the page

character(len=*), intent(in) :: old_bytes

Page pre-image (empty if is_new)

logical, intent(in) :: is_new

Page is newly allocated this txn

integer, intent(out) :: stat

0 = OK; non-zero aborts the write