I have some curiosity regarding how SMB file sharing works in Windows.
Specifically, what is done in UM and what is done in KM, how is the
SMB server notified when an OpLock is broken and how does the server
interact with Junctions, Symlinks or Reparse Points.
A SMB file sharing daemon could be implemented entirely in userspace
and use the regular user space I/O API to access the underlying File
System. This is what Samba does on UNIX and UNIX-like operating
systems. Some things are better if you have Kernel support though. For
example, an OpLock is not broken only in the case if a remote client
tries to access a file opened previously by another remote client, but
it should also be broken if that file is opened locally. Also, the
local call to CreateFile() should be blocked in the file system stack
until the OpLock would have been broken and acknowledged remotely, to
preserve SMB semantics and cache coherency. This thinks cannot happen
without kernel support. I am curious about the way Windows does this.
What exactly is implemented in KM and what in UM?
I am also curious about how the SMB server handles Junctions, Symlinks
and Reparse Points. Is everything implemented in the File System stack
or does the server implement some explict support. If I `dir' a remote
share, I still see Junctions and Symlinks, not the targets themselves.
How is this implemented?