| # lpt0 = # lpt, (5 + 2 * lptlebs(# lpt, LEB_SIZE)) + # lpt = # avol0, avol0[1] = mapped(buf1), avol0[3] = mapped(buf0), avol0[0] = mapped(buf), avol = avol0[2, mapped(mkbuf(0))], orphans1 = orphans, sb1 = mksb(adr, m3, 2, 4, # orphans, 5 + lptlebs(# lpt, LEB_SIZE), 5 + 2 * lptlebs(# lpt, LEB_SIZE)), 4 < # avol0, 2 < # avol0, ebm-vol-inv(avol0), ebm-vol-inv(avol0[2, mapped(mkbuf(0))]), is-encoded(mksb(adr0, m2, 1, 3, m6, 5, 5 + 2 * lptlebs(# lpt, LEB_SIZE)), buf), is-encoded(lpt0, lebs(avol0, 5, lptlebs(# lpt, LEB_SIZE))), is-encoded(log, buf1), is-encoded-pad(orphans0, m6, buf0), mapped-full?(avol0, 5, lptlebs(# lpt, LEB_SIZE)), 5 + 2 * lptlebs(# lpt, LEB_SIZE) ≤ # avol0, logoff ≠ LEB_SIZE → # buf1 = logoff ⊦ [persistence_io_write_orphans#(4, EB_PAGE_SIZE, LEB_SIZE; orphans, avol; err0)] ( (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ ebm-vol-inv(avol) ∧ id○(avol, avol0[2, mapped(mkbuf(0))], 4) ∧ (err0 = ESUCCESS → avol[4].mapped? ∧ is-encoded-pad(orphans1, # orphans1, avol[4].data)) → ⟪m0 := LEB_SIZE; if err0 = ESUCCESS then let buf = ? in {persistence_io_encode_lpt#(lpt, m0; ; buf, err0); if err0 = ESUCCESS then persistence_io_write_lebs#(sb1.lpt, lptlebs(# lpt, m0), buf, m0; avol; err0)}; if err0 = ESUCCESS then ebm_avol_sync_device#(avol; ; err0); if err0 = ESUCCESS then persistence_io_write_superblock#(sb1, EB_PAGE_SIZE, m0; avol; err0); sb0 := mksb(adr0, m2, 1, 3, m6, 5, 5 + 2 * lptlebs(# lpt, LEB_SIZE)); if err0 = ESUCCESS then {sb0 := sb1; logoff := 0}⟫ ( (∃ lpt1, log, orphans. disk-layout(sb0, # lpt1) ∧ sb0.main + # lpt1 = # avol ∧ avol[0].mapped? ∧ is-encoded(sb0, avol[0].data) ∧ avol[sb0.orph].mapped? ∧ is-encoded-pad(orphans, sb0.orphsize, avol[sb0.orph].data) ∧ avol[sb0.log].mapped? ∧ (logoff ≠ LEB_SIZE → # avol[sb0.log].data = logoff) ∧ is-encoded(log, avol[sb0.log].data) ∧ mapped-full?(avol, sb0.lpt, lptlebs(# lpt1, LEB_SIZE)) ∧ is-encoded(lpt1, lebs(avol, sb0.lpt, lptlebs(# lpt1, LEB_SIZE)))) ∧ ebm-vol-inv(avol) ∧ (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ ( err0 = ESUCCESS → sb0.indexaddr = adr ∧ sb0.maxino = m3 ∧ avol[sb0.log].data = mkbuf(0) ∧ is-encoded(lpt, lebs(avol, sb0.lpt, lptlebs(# avol - sb0.main, LEB_SIZE))) ∧ is-encoded-pad(orphans1, sb0.orphsize, avol[sb0.orph].data)) ∧ ( err0 ≠ ESUCCESS → sb0 = mksb(adr0, m2, 1, 3, m6, 5, sb0.main) ∧ avol[1] = avol0[1] ∧ avol[3] = avol0[3] ∧ lebs(avol, 5, lptlebs(# avol - sb0.main, LEB_SIZE)) = lebs(avol0, 5, lptlebs(# avol - sb0.main, LEB_SIZE))) ∧ sb0.main = 5 + 2 * lptlebs(# lpt, LEB_SIZE) ∧ # avol = # avol0 ∧ subarray(avol, sb0.main, # avol - sb0.main) = subarray(avol0, sb0.main, # avol - sb0.main))) |
# lpt0 = # lpt, (5 + 2 * lptlebs(# lpt, LEB_SIZE)) + # lpt = # avol0, avol0[0] = mapped(buf), avol0[3] = mapped(buf0), avol0[1] = mapped(buf1), avol = avol0[2, mapped(mkbuf(0))], orphans1 = orphans, sb1 = mksb(adr, m3, 2, 4, # orphans, 5 + lptlebs(# lpt, LEB_SIZE), 5 + 2 * lptlebs(# lpt, LEB_SIZE)), 2 < # avol0, 4 < # avol0, ebm-vol-inv(avol0[2, mapped(mkbuf(0))]), ebm-vol-inv(avol0), is-encoded(log, buf1), is-encoded(lpt0, lebs(avol0, 5, lptlebs(# lpt, LEB_SIZE))), is-encoded(mksb(adr0, m2, 1, 3, m6, 5, 5 + 2 * lptlebs(# lpt, LEB_SIZE)), buf), is-encoded-pad(orphans0, m6, buf0), mapped-full?(avol0, 5, lptlebs(# lpt, LEB_SIZE)), 5 + 2 * lptlebs(# lpt, LEB_SIZE) ≤ # avol0, logoff ≠ LEB_SIZE → # buf1 = logoff ⊦ ∀ orphans, avol, err0. (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ ebm-vol-inv(avol) ∧ id○(avol, avol0[2, mapped(mkbuf(0))], 4) ∧ (err0 = ESUCCESS → avol[4].mapped? ∧ is-encoded-pad(orphans1, # orphans1, avol[4].data)) → ⟪m0 := LEB_SIZE; if err0 = ESUCCESS then let buf = ? in {persistence_io_encode_lpt#(lpt, m0; ; buf, err0); if err0 = ESUCCESS then persistence_io_write_lebs#(sb1.lpt, lptlebs(# lpt, m0), buf, m0; avol; err0)}; if err0 = ESUCCESS then ebm_avol_sync_device#(avol; ; err0); if err0 = ESUCCESS then persistence_io_write_superblock#(sb1, EB_PAGE_SIZE, m0; avol; err0); sb0 := mksb(adr0, m2, 1, 3, m6, 5, 5 + 2 * lptlebs(# lpt, LEB_SIZE)); if err0 = ESUCCESS then {sb0 := sb1; logoff := 0}⟫ ( (∃ lpt1, log, orphans. disk-layout(sb0, # lpt1) ∧ sb0.main + # lpt1 = # avol ∧ avol[0].mapped? ∧ is-encoded(sb0, avol[0].data) ∧ avol[sb0.orph].mapped? ∧ is-encoded-pad(orphans, sb0.orphsize, avol[sb0.orph].data) ∧ avol[sb0.log].mapped? ∧ (logoff ≠ LEB_SIZE → # avol[sb0.log].data = logoff) ∧ is-encoded(log, avol[sb0.log].data) ∧ mapped-full?(avol, sb0.lpt, lptlebs(# lpt1, LEB_SIZE)) ∧ is-encoded(lpt1, lebs(avol, sb0.lpt, lptlebs(# lpt1, LEB_SIZE)))) ∧ ebm-vol-inv(avol) ∧ (err0 = ESUCCESS ∨ ⌊err0⌋ ) ∧ ( err0 = ESUCCESS → sb0.indexaddr = adr ∧ sb0.maxino = m3 ∧ avol[sb0.log].data = mkbuf(0) ∧ is-encoded(lpt, lebs(avol, sb0.lpt, lptlebs(# avol - sb0.main, LEB_SIZE))) ∧ is-encoded-pad(orphans1, sb0.orphsize, avol[sb0.orph].data)) ∧ ( err0 ≠ ESUCCESS → sb0 = mksb(adr0, m2, 1, 3, m6, 5, sb0.main) ∧ avol[1] = avol0[1] ∧ avol[3] = avol0[3] ∧ lebs(avol, 5, lptlebs(# avol - sb0.main, LEB_SIZE)) = lebs(avol0, 5, lptlebs(# avol - sb0.main, LEB_SIZE))) ∧ sb0.main = 5 + 2 * lptlebs(# lpt, LEB_SIZE) ∧ # avol = # avol0 ∧ subarray(avol, sb0.main, # avol - sb0.main) = subarray(avol0, sb0.main, # avol - sb0.main))