| files[m] = mkfile(m1, md1, # links(m, dirs), content0), pcache[datakey(m, m2 / VFS_PAGE_SIZE)] = mkpentry(boolvar, buf), buf-opt = some(buf), err = ESUCCESS, inode = mkinode(m, md, false, # links(m, dirs), 0, m2), afs-cons(dirs, files), dcache-cons(dcache, dirs, files), icache-cons(icache, dirs, files), pcache-cons(pcache, dirs, files), synced(dirs, icache, pcache), m ∈ files, datakey(m, m2 / VFS_PAGE_SIZE) ∈ pcache, asynced2 → synced(files, icache, pcache) ⊦ ⟪afs_truncate#(n, m2 / VFS_PAGE_SIZE; buf-opt, inode, asynced4, err, dirs, files, asynced3); if err = ESUCCESS then let asynced = false in {icache_set#(inode, asynced; err, icache); pcache_truncate#(inode.ino, m2, n; err, pcache); if asynced4 then pcache_set#(inode.ino, m2 / VFS_PAGE_SIZE, buf-opt.buf, asynced; err, pcache)}; if ¬ asynced4 ∨ err ≠ ESUCCESS then buf-opt := none⟫ ( icache-cons(icache, dirs, files) ∧ dcache-cons(dcache, dirs, files) ∧ pcache-cons(pcache, dirs, files) ∧ afs-cons(dirs, files) ∧ synced(dirs, icache, pcache) ∧ (asynced2 → synced(files, icache, pcache))) |
afs-cons(dirs, files), pre-truncate(inode, n, pageno, buf-opt, dirs, files) ⊦ ⟪afs_truncate#(n, pageno; buf-opt, inode, asynced, err, dirs, files, asynced0)⟫ afs-cons(dirs, files)
pcache[datakey(m, m2 / VFS_PAGE_SIZE)] = mkpentry(boolvar, buf), files[m] = mkfile(m1, md1, # links(m, dirs), content0), buf-opt = some(buf), err = ESUCCESS, inode = mkinode(m, md, false, # links(m, dirs), 0, m2), afs-cons(dirs, files), dcache-cons(dcache, dirs, files), icache-cons(icache, dirs, files), pcache-cons(pcache, dirs, files), synced(dirs, icache, pcache), datakey(m, m2 / VFS_PAGE_SIZE) ∈ pcache, m ∈ files, asynced2 → synced(files, icache, pcache) ⊦ afs-cons(dirs, files) ∧ pre-truncate(inode, n, m2 / VFS_PAGE_SIZE, buf-opt, dirs, files)
pcache[datakey(m, m2 / VFS_PAGE_SIZE)] = mkpentry(boolvar, buf), files[m] = mkfile(m1, md1, # links(m, dirs), content0), buf-opt = some(buf), err = ESUCCESS, inode = mkinode(m, md, false, # links(m, dirs), 0, m2), n0 = n, pageno0 = m2 / VFS_PAGE_SIZE, afs-cons(dirs, files), dcache-cons(dcache, dirs, files), icache-cons(icache, dirs, files), pcache-cons(pcache, dirs, files), pre-truncate(inode, n, m2 / VFS_PAGE_SIZE, buf-opt, dirs, files), synced(dirs, icache, pcache), datakey(m, m2 / VFS_PAGE_SIZE) ∈ pcache, m ∈ files, asynced2 → synced(files, icache, pcache) ⊦ [afs_truncate#(n, m2 / VFS_PAGE_SIZE; buf-opt, inode, asynced4, err, dirs, files, asynced3)] ( afs-cons(dirs, files) → ⟪if err = ESUCCESS then let asynced = false in {icache_set#(inode, asynced; err, icache); pcache_truncate#(inode.ino, m2, n; err, pcache); if asynced4 then pcache_set#(inode.ino, m2 / VFS_PAGE_SIZE, buf-opt.buf, asynced; err, pcache)}; if ¬ asynced4 ∨ err ≠ ESUCCESS then buf-opt := none⟫ ( icache-cons(icache, dirs, files) ∧ dcache-cons(dcache, dirs, files) ∧ pcache-cons(pcache, dirs, files) ∧ afs-cons(dirs, files) ∧ synced(dirs, icache, pcache) ∧ (asynced2 → synced(files, icache, pcache))))