| VFS_PAGE_SIZE = n0 + m0 % VFS_PAGE_SIZE, files1[ino2] = mkfile(m0, md0, # links(ino2, dirs), content0), fs = abs-files(files1), root.dir?, dom of < ino3, abs(root, ROOT_INO)(dirs), afs-cons (dirs, files1 [ino2, mkfile(n, md0, # links(ino2, dirs), content0[m0 / VFS_PAGE_SIZE, fill(content0[m0 / VFS_PAGE_SIZE], zero, m0 % VFS_PAGE_SIZE, n0)] upto m0) ]), afs-cons(dirs, files1), fids-cons(root, abs-files(files1), abs-of(of)), ispath(path, ROOT_INO, ino2, dirs, files1), of-cons (of, dirs, files1 [ino2, mkfile(n, md0, # links(ino2, dirs), content0[m0 / VFS_PAGE_SIZE, fill(content0[m0 / VFS_PAGE_SIZE], zero, m0 % VFS_PAGE_SIZE, n0)] upto m0) ]), of-cons(of, dirs, files1), pw(user, md0), px-parent(user, path, ROOT_INO, dirs, files1), ROOT_INO ∈ dirs, ino2 ∈ files1, m0 / VFS_PAGE_SIZE ∈ content0, m0 ≤ n, psynced → asynced0 ⊦ ⟨posix_truncate#(path, n, user, root, abs-of(of); err1, fs; psynced)⟩ ( fs = abs-files (files1 [ino2, mkfile (n, md0, # links(ino2, dirs), content0[m0 / VFS_PAGE_SIZE, fill(content0[m0 / VFS_PAGE_SIZE], zero, m0 % VFS_PAGE_SIZE, n0)] upto m0) ]) ∧ (psynced → asynced) ∧ ESUCCESS = err1), m0 % VFS_PAGE_SIZE = 0, root[path].dir?, ino2 ∈ dirs |
VFS_PAGE_SIZE = n0 + m0 % VFS_PAGE_SIZE, files1[ino2] = mkfile(m0, md0, # links(ino2, dirs), content0), err0 = err1, fs = abs-files(files1), ofh = abs-of(of), root.dir?, dom of < ino3, abs(root, ROOT_INO)(dirs), afs-cons(dirs, files1), afs-cons (dirs, files1 [ino2, mkfile(n, md0, # links(ino2, dirs), content0[m0 / VFS_PAGE_SIZE, fill(content0[m0 / VFS_PAGE_SIZE], zero, m0 % VFS_PAGE_SIZE, n0)] upto m0) ]), fids-cons(root, abs-files(files1), abs-of(of)), ispath(path, ROOT_INO, ino2, dirs, files1), of-cons(of, dirs, files1), of-cons (of, dirs, files1 [ino2, mkfile(n, md0, # links(ino2, dirs), content0[m0 / VFS_PAGE_SIZE, fill(content0[m0 / VFS_PAGE_SIZE], zero, m0 % VFS_PAGE_SIZE, n0)] upto m0) ]), pw(user, md0), px-parent(user, path, ROOT_INO, dirs, files1), m0 / VFS_PAGE_SIZE ∈ content0, ino2 ∈ files1, ROOT_INO ∈ dirs, m0 ≤ n, psynced → asynced0 ⊦ ⟨choose err with pre-truncate(path, n, err, user, root, fs, ofh) in err0 := err; if err0 = ESUCCESS then let fid = root[path].fid in let buf = fs[fid].content in fs[fid].content := resize(buf, n); psynced := ?⟩ ( fs = abs-files (files1 [ino2, mkfile (n, md0, # links(ino2, dirs), content0[m0 / VFS_PAGE_SIZE, fill(content0[m0 / VFS_PAGE_SIZE], zero, m0 % VFS_PAGE_SIZE, n0)] upto m0) ]) ∧ (psynced → asynced) ∧ ESUCCESS = err0), m0 % VFS_PAGE_SIZE = 0, root[path].dir?, ino2 ∈ dirs
Used simplifier rules: posix_truncate#(PATH, N, USER, ROOT, OFH; ERR, FS; PSYNCED) {choose E with pre-truncate(PATH, N, E, USER, ROOT, FS, OFH) in ERR := E; if ERR = ESUCCESS then let FID = ROOT[PATH].fid in let BUF = FS[FID].content in FS[FID].content := resize(BUF, N); PSYNCED := ? };