I'm not sure fsync(2)
is atomic; if a file has 100 megabytes dirty in the buffer cache, it'll take several seconds to write that data out, and the kernel may crash while the transfer to disk is in progress. Perhaps the DMA engine on board can only handle 4-megabyte writes. Perhaps there is no DMA support, and the CPU must schedule every write via 512 byte blocks.
What do you mean by 'atomic'?
mkdir
is probably 'atomic', either the directory exists on disk and is linked in to a parent directory, or the directory data structure isn't yet linked into a parent directory, and is therefore unreachable --> doesn't exist.
Same might go for mount(2)
: it would be hard to find a mount(2)
half-way complete, and if it fails, the entire mount fails: either the filesystem is mounted, or it isn't.
umount(2)
is funny, it can be done lazily, but once it is unmounted, it cannot be used for open(2)
or creat(2)
calls.
So, I guess it comes down to, what do you mean by 'atomic'? :)