WinFuse is a suite of software components that allows FUSE file systems to run on Windows. Both Windows and Linux (WSL1) FUSE file systems are supported. Windows FUSE file systems are supported via a kernel driver that exposes the FUSE protocol via DeviceIoControl
and a port of the libfuse library compiled as a Windows DLL. Linux FUSE file systems are expected to run in the WSL1 environment and are supported via a kernel driver that exposes /dev/fuse
.
The following component diagram shows the WinFuse project components and their relations to the Windows OS (NTOS), WSL (LXCORE) and components that are provided by other projects.
The components and their interfaces are:
- The winfsp component which is provided by the WinFsp project.
- The component is an NTOS File System Driver (FSD).
- The component provides an FSP_FSCTL_TRANSACT
DeviceIoControl
interface. - The component is responsible for loading the winfuse component.
- The winfuse component which is provided by the WinFuse project (this project).
- The component is an NTOS driver.
- The component provides an FUSE_FSCTL_TRANSACT
DeviceIoControl
interface. - The component connects to the FSP_FSCTL_TRANSACT interface. WinFsp file system requests retrieved via this interface are translated to FUSE file system requests and become available via FUSE_FSCTL_TRANSACT.
- The wslfuse component which is provided by the WinFuse project (this project).
- The component is an LXCORE driver.
- The component provides a /dev/fuse Linux interface.
- The component connects to the FSP_FSCTL_TRANSACT interface. WinFsp file system requests retrieved via this interface are translated to FUSE file system requests and become available via /dev/fuse.
- The lxldr component which is provided by the LxDK project.
- The component is an LXCORE driver.
- The component is responsible for loading the wslfuse component.
- The file system (FS) components which are user-mode programs provided by third parties.
- A Windows WinFsp file system connects to the FSP_FSCTL_TRANSACT interface.
- A Windows FUSE file system connects to the FUSE_FSCTL_TRANSACT interface.
- A Linux FUSE file system connects to the /dev/fuse interface.
The following sequence diagrams show how the WinFuse project components interact with other components in two scenarios: (1) I/O handled by a Windows FUSE file system, and (2) I/O handled by a Linux FUSE file system.
- The I/O originates with one of:
- A Windows process which uses a familiar API like
ReadFile
orWriteFile
. - A WSL (Linux) process which uses an API like
read(2)
orwrite(2)
that LXCORE translates into the equivalentNtReadFile
orNtWriteFile
.
- A Windows process which uses a familiar API like
- The Windows OS (NTOS) packages this I/O into an IRP (I/O Request Packet) and routes it to the winfsp FSD.
- The winfsp FSD posts the request into an internal I/O queue. This request is retrieved at a later time and in a different process context via an
FSP_FSCTL_TRANSACT
(issued viaDeviceIoControl
) by the winfuse driver. - The winfuse driver translates the request to equivalent FUSE requests, which are then retrieved via an
FUSE_FSCTL_TRANSACT
(issued viaDeviceIoControl
) by the Windows FUSE file system. - The Windows FUSE file system processes the request and prepares a response, which it sends to the winfuse driver via another
FUSE_FSCTL_TRANSACT
. - The winfuse driver processes the FUSE response and it may issue additional FUSE requests or it may translate it to a final WinFsp response, which it sends to the winfsp FSD via another
FSP_FSCTL_TRANSACT
. - The winfsp FSD completes the corresponding I/O, which allows the Originating Process to resume and retrieve the response.
This case is similar to the previous case except that the winfuse driver is replaced by the wslfuse driver that exposes the FUSE protocol via the /dev/fuse interface that the Linux FUSE file system understands.