| files[m] = mkfile(m0, md0, # links(m, dirs), content), buf-opt = none, 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)] ( 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) ∧ synced(dirs, icache, pcache) ∧ (asynced2 → synced(files, icache, pcache)))) |
asynced0 ↔ asynced4, asynced ↔ asynced3, files[m] = mkfile(m0, md0, # links(m, dirs), content), buf-opt = none, err = ESUCCESS, inode = mkinode(m, md, false, # links(m, dirs), 0, m2), pageno = m2 / VFS_PAGE_SIZE, 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, asynced2 → synced(files, icache, pcache) ⊦ [if pre-truncate(inode, n, pageno, buf-opt, dirs, files) then let old_ino = 0, size = 0 in afs_truncate_internal#(n, pageno; inode, buf-opt, old_ino, size, asynced0, err, dirs, files; asynced) else abort] ( afs-cons(dirs, files) → ⟪asynced4 := asynced0; 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) ∧ synced(dirs, icache, pcache) ∧ (asynced2 → synced(files, icache, pcache)))), VFS_PAGE_SIZE = 0, datakey(m, m2 / VFS_PAGE_SIZE) ∈ pcache
Used simplifier rules: afs_truncate# (N, PAGENO; PBUF-OPT, INODE, MODIFIED, ERR, DIRS, FILES, ASYNCED) {if pre-truncate(INODE, N, PAGENO, PBUF-OPT, DIRS, FILES) then let OFFSET = 0, SIZE = 0 in afs_truncate_internal# (N, PAGENO ; INODE, PBUF-OPT, OFFSET, SIZE, MODIFIED, ERR, DIRS, FILES ; ASYNCED) else abort };