| m = m1, m0 = m2, n0 = n, n1 = n2, v = default-volid, m2 < # avols[default-volid], ebm-cons(avols), is-aligned(n, EB_PAGE_SIZE), is-aligned(m1, EB_PAGE_SIZE), default-volid ∈ avols, n + n2 ≤ # buf, m1 + n ≤ LEB_SIZE, avols[default-volid][m2].mapped? → avols[default-volid][m2].fill ≤ m1 ⊦ [fail_or_success#(; ; err); if err = ESUCCESS then if avols[v][m0].mapped? then if n0 ≠ 0 then avols[v][m0] := mapped(subarray(avols[v][m0].data, 0, m) + subarray(buf, n1, n0) + mkempbuf(LEB_SIZE - m - n0), m + n0) else avols[v][m0] := mapped(mkempbuf(m) + subarray(buf, n1, n0) + mkempbuf(LEB_SIZE - m - n0), m + n0) else if avols[v][m0].mapped? then choose n with n < n0 ∧ is-aligned(n, EB_PAGE_SIZE) in if n ≠ 0 then avols[v][m0] := mapped(subarray(avols[v][m0].data, 0, m) + subarray(buf, n1, n) + mkempbuf(LEB_SIZE - m - n), m + n) ifnone skip else if n0 ≠ 0 then avols[v][m0] := unmapped] (ebm-cons(avols) → default-volid ∈ avols) |
m2 < # avols[default-volid], ebm-cons(avols), is-aligned(m1, EB_PAGE_SIZE), is-aligned(n, EB_PAGE_SIZE), default-volid ∈ avols, m1 + n ≤ LEB_SIZE, n + n2 ≤ # buf, avols[default-volid][m2].mapped? → avols[default-volid][m2].fill ≤ m1 ⊦ [fail_or_success#(; ; err); if err = ESUCCESS then if avols[default-volid][m2].mapped? then if n ≠ 0 then avols[default-volid][m2] := mapped(subarray(avols[default-volid][m2].data, 0, m1) + subarray(buf, n2, n) + mkempbuf(LEB_SIZE - m1 - n), m1 + n) else avols[default-volid][m2] := mapped(mkempbuf(m1) + subarray(buf, n2, n) + mkempbuf(LEB_SIZE - m1 - n), m1 + n) else if avols[default-volid][m2].mapped? then {v := default-volid; choose n1 with n1 < n ∧ is-aligned(n1, EB_PAGE_SIZE) in if n1 ≠ 0 then avols[v][m2] := mapped(subarray(avols[v][m2].data, 0, m1) + subarray(buf, n2, n1) + mkempbuf(LEB_SIZE - m1 - n1), m1 + n1) ifnone skip} else if n ≠ 0 then avols[default-volid][m2] := unmapped] (ebm-cons(avols) → default-volid ∈ avols)