3 ms·
This is reasonable, but this does not necessarily preclude the file from being deleted from the directory. If an open file is deleted, it's no longer enumerabl
by nine_k 3y ago
This is reasonable, but this does not necessarily preclude the file from being deleted from the directory.
If an open file is deleted, it's no longer enumerable in the file system. But its pages / blocks / whatever are still there on the disk, marked as used, and can back the page cache.
Once the file is closed, the filesystem notices that the blocks do not belong to a file accessible from outside, and garbage-collects the data blocks. It all closely resembles reference-counted GC.