| boolvar ↔ boolvar0, files1[m] = mkfile(m0, md0, m1, content), buf-opt = buf-opt0, dirs = dirs1, files = files1, inode = mkinode(m, md, false, m1, 0, m2), pageno = 0, pageno0 = 0, pageno1 = m2 / VFS_PAGE_SIZE, m ∈ files1, ⌊err1⌋ , buf-opt0.some? → # buf-opt0.buf = VFS_PAGE_SIZE ⊦ ⟨ let ino = inode.ino, content = files[inode.ino].content, buf = ? in {pageno0 := inode.size % VFS_PAGE_SIZE, pageno := min(n, inode.size); boolvar := inode.size ≤ n ∧ pageno0 ≠ 0 ∧ (pageno1 ∈ content ∨ buf-opt.some?); if boolvar then {if buf-opt.some? then buf := buf-opt.buf else buf := files[ino].content[pageno1]; buf := fill(buf, zero, pageno0, VFS_PAGE_SIZE - pageno0); content[pageno1] := buf; buf-opt := some(buf)}; files[ino].content := content upto pageno; let new_inode = inode in {new_inode.size := n; afs_inode_sync#(new_inode; dirs, files)}; inode := getinode(inode.ino, dirs, files); err := ESUCCESS} or fail#(; ; err); asynced := ?⟩ (buf-opt = buf-opt0 ∧ inode = mkinode(m, md, false, m1, 0, m2) ∧ (boolvar ↔ boolvar0) ∧ err = err1 ∧ dirs = dirs1 ∧ files = files1), VFS_PAGE_SIZE = 0 |
boolvar ↔ boolvar0, files1[m] = mkfile(m0, md0, m1, content), buf-opt = buf-opt0, dirs = dirs1, files = files1, inode = mkinode(m, md, false, m1, 0, m2), pageno = 0, pageno0 = 0, pageno1 = m2 / VFS_PAGE_SIZE, m ∈ files1, ⌊err1⌋ , buf-opt0.some? → # buf-opt0.buf = VFS_PAGE_SIZE ⊦ ⟨fail#(; ; err); asynced := ?⟩ (buf-opt = buf-opt0 ∧ inode = mkinode(m, md, false, m1, 0, m2) ∧ (boolvar ↔ boolvar0) ∧ err = err1 ∧ dirs = dirs1 ∧ files = files1), ⟨let ino = inode.ino, content = files[inode.ino].content, buf = ? in {pageno0 := inode.size % VFS_PAGE_SIZE, pageno := min(n, inode.size); boolvar := inode.size ≤ n ∧ pageno0 ≠ 0 ∧ (pageno1 ∈ content ∨ buf-opt.some?); if boolvar then {if buf-opt.some? then buf := buf-opt.buf else buf := files[ino].content[pageno1]; buf := fill(buf, zero, pageno0, VFS_PAGE_SIZE - pageno0); content[pageno1] := buf; buf-opt := some(buf)}; files[ino].content := content upto pageno; let new_inode = inode in {new_inode.size := n; afs_inode_sync#(new_inode; dirs, files)}; inode := getinode(inode.ino, dirs, files); err := ESUCCESS}; asynced := ?⟩ (buf-opt = buf-opt0 ∧ inode = mkinode(m, md, false, m1, 0, m2) ∧ (boolvar ↔ boolvar0) ∧ err = err1 ∧ dirs = dirs1 ∧ files = files1), VFS_PAGE_SIZE = 0