Pretending to Be a Filesystem
It’s all well and good having a shiny object-based transactional data-storage system, but who is going to use it? All of my applications want to talk to something that looks a lot like a UNIX filesystem. This is where ZPL, the ZFS POSIX layer, comes in. ZPL performs a mapping between POSIX file operations (read, write, etc.) and underlying DMU operations. It’s responsible for managing the directory structure and enforcing access-control lists.
In addition to ZPL, ZFS has another interface layer module known as ZVOL. This layer performs a much simpler mapping; rather than presenting the appearance of a POSIX-compliant filesystem, it appears to be a raw block device, which is useful for implementing existing filesystems backed by ZFS storage pools. The FreeBSD port initially used the existing UFS2 filesystem on top of a ZVOL device. I would imagine that Apple’s port will use HFS+ on top of ZVOL to allow Apple to keep support for HFS+ metadata.
Some intriguing possibilities are available for future work in this layer. Because ZFS already supports transactions, it’s conceivable that SQL or a similar interface could appear in this layer. Due to the low cost of creating filesystems, each user could create databases on the fly and have a much more flexible interface provided than that of the POSIX layer. The problem of Microsoft’s WinFS—that it was too difficult to get everyone to support an approach that wasn’t based on files—wouldn’t apply, since the facility would augment rather than replace the current filesystem.