| # lpt = # avol, # buf1 = EB_PAGE_SIZE, avol[m4] = mapped(buf2), bleb = buffered(m4), buf0 = buf, m = m3, m0 = EB_PAGE_SIZE, n2 = n, ¬ rofs, wbuf = mkwbuf(buf1, m1, m2), m4 < # avol, ebm-vol-inv(avol), wbuf-cons(mkwbuf(buf1, m1, m2), mapped(buf2), rofs), ¬ rofs → m1 + m2 + n ≤ LEB_SIZE ∧ n ≤ # buf ⊦ ⟪if wbuf.nbytes + n2 ≥ m0 then let n1 = align↓(wbuf.nbytes + n2, m0) in let n0 = n1 - wbuf.nbytes in let n = (wbuf.nbytes + n2) % m0 in let buf = mkbuf(n1) in {buf := copy(wbuf.content, 0, buf, 0, wbuf.nbytes); buf := copy(buf0, 0, buf, wbuf.nbytes, n0); apersistence_io_write#(bleb.leb, wbuf.offset, 0, n1, buf, adr, m, plog, lpt, ns; avol; err); if err = ESUCCESS then {wbuf.content := copy(buf0, n0, wbuf.content, 0, n); wbuf.offset := wbuf.offset + n1; wbuf.nbytes := n} else rofs := true} else {wbuf.content := copy(buf0, 0, wbuf.content, wbuf.nbytes, n2); wbuf.nbytes := wbuf.nbytes + n2; err := ESUCCESS}⟫ (# wbuf.content = EB_PAGE_SIZE ∧ m4 < # avol ∧ wbuf-cons(wbuf, avol[m4], rofs) ∧ ebm-vol-inv(avol) ∧ # lpt = # avol) |
# buf1 = EB_PAGE_SIZE, # lpt = # avol, avol[m4] = mapped(buf2), bleb = buffered(m4), buf0 = buf, m = m3, m0 = EB_PAGE_SIZE, n2 = n, ¬ rofs, wbuf = mkwbuf(buf1, m1, m2), m4 < # avol, ebm-vol-inv(avol), wbuf-cons(mkwbuf(buf1, m1, m2), mapped(buf2), rofs), wbuf.nbytes + n2 ≥ m0, ¬ rofs → m1 + m2 + n ≤ LEB_SIZE ∧ n ≤ # buf ⊦ ⟪let n1 = align↓(wbuf.nbytes + n2, m0) in let n0 = n1 - wbuf.nbytes in let n = (wbuf.nbytes + n2) % m0 in let buf = mkbuf(n1) in {buf := copy(wbuf.content, 0, buf, 0, wbuf.nbytes); buf := copy(buf0, 0, buf, wbuf.nbytes, n0); apersistence_io_write#(bleb.leb, wbuf.offset, 0, n1, buf, adr, m, plog, lpt, ns; avol; err); if err = ESUCCESS then {wbuf.content := copy(buf0, n0, wbuf.content, 0, n); wbuf.offset := wbuf.offset + n1; wbuf.nbytes := n} else rofs := true}⟫ (# wbuf.content = EB_PAGE_SIZE ∧ m4 < # avol ∧ wbuf-cons(wbuf, avol[m4], rofs) ∧ ebm-vol-inv(avol) ∧ # lpt = # avol)
# buf1 = EB_PAGE_SIZE, # lpt = # avol, avol[m4] = mapped(buf2), bleb = buffered(m4), buf0 = buf, m = m3, m0 = EB_PAGE_SIZE, n2 = n, ¬ rofs, wbuf = mkwbuf(buf1, m1, m2), m4 < # avol, ebm-vol-inv(avol), wbuf-cons(mkwbuf(buf1, m1, m2), mapped(buf2), rofs), ¬ rofs → m1 + m2 + n ≤ LEB_SIZE ∧ n ≤ # buf ⊦ ⟪wbuf.content := copy(buf0, 0, wbuf.content, wbuf.nbytes, n2); wbuf.nbytes := wbuf.nbytes + n2; err := ESUCCESS⟫ (# wbuf.content = EB_PAGE_SIZE ∧ m4 < # avol ∧ wbuf-cons(wbuf, avol[m4], rofs) ∧ ebm-vol-inv(avol) ∧ # lpt = # avol), wbuf.nbytes + n2 ≥ m0