dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.21k stars 661 forks source link

Kernel - Remove unnecessary FCB lock for FileName #1060

Open Liryna opened 2 years ago

Liryna commented 2 years ago

The kernel has multiple Fcb readonly locks just to copy the FileName to the request sent to the user filesystem in userland. This is unnecessary as the FileName is only changing during a rename which userland is aware of.

Like here where the kernel copy the FileName https://github.com/dokan-dev/dokany/blob/master/sys/cleanup.c#L97-L116 so userland can just pass it to the user filesystem here https://github.com/dokan-dev/dokany/blob/master/dokan/cleanup.c#L41

Userland library should store the FileName given during CreateFile in a shared object that is shared between open context (of same FileName) and updated during MoveFile. The following request (after CreateFile) would use the UserContext to retrieve the FileName instance and pass it (safely) to callbacks.