Here's rm.cc and a couple of things fixed in unlink.
I'm still not sure about the best way to implement the check for whether any other processes have the file open. There's no really good way to check how many times a given file is open, besides just searching through the entire openFiles array and comparing file descriptors
We don’t have any performance requirements other than correctness, so I think being O(n) on the number of open files is fine. That’s probably how it’s implemented in the Linux kernel anyway.
Here's rm.cc and a couple of things fixed in unlink.
I'm still not sure about the best way to implement the check for whether any other processes have the file open. There's no really good way to check how many times a given file is open, besides just searching through the entire
openFiles
array and comparing file descriptors