(entry: FileEntry)
| 313 | }; |
| 314 | |
| 315 | const pendingStat = (entry: FileEntry): FuseStat => { |
| 316 | return { |
| 317 | // Frozen from create() so consecutive stats of an unchanged |
| 318 | // pending-create file return the same timestamps. Critical for |
| 319 | // auto_cache: an advancing mtime would force the kernel to drop |
| 320 | // the page cache on every open before the first flush lands. |
| 321 | mtime: entry.pendingMtime, |
| 322 | atime: entry.pendingMtime, |
| 323 | ctime: entry.pendingMtime, |
| 324 | size: entry.size, |
| 325 | // S_IFREG | permission bits. The driver only ever stages regular |
| 326 | // files this way; directories and symlinks go straight to the |
| 327 | // VFS in their own ops. |
| 328 | mode: 0o100000 | (entry.mode & 0o7777), |
| 329 | uid: typeof process.getuid === "function" ? process.getuid() : 0, |
| 330 | gid: typeof process.getgid === "function" ? process.getgid() : 0, |
| 331 | nlink: 1, |
| 332 | ino: 0, |
| 333 | blksize: PREFERRED_IO_BLOCK_SIZE, |
| 334 | blocks: blocksForSize(entry.size), |
| 335 | }; |
| 336 | }; |
| 337 | // Returns true on success, false if `needed` exceeds MAX_FILE_BYTES. |
| 338 | // Callers must surface the failure to FUSE as EFBIG. |
| 339 | const ensureCapacity = (entry: FileEntry, needed: number): boolean => { |
no test coverage detected