Writing a Samba VFS in Samba 3.6 and earlier
This document is intended to help people who want to write Samba VFS modules. It is a Wiki-based version of an earlier document written by Richard Sharpe that can be found at Writing a Samba VFS.
The rest of this document is organized into a number of sections that:
- Provides and outline of the Samba VFS and discuss the interactions between the main Samba code, the VFS Layer, VFS modules and the underlying OS.
- Discusses two different types of file systems that module writers might want to write a VFS module for.
The Samba VFS
Two Types of File Systems
Writing a VFS Module
VFS Module Initialization
VFS Function Pointer Structure
The Life Cycle of a VFS
Memory Management and talloc
Providing Context between Calls
Module Specific Parameters
Extending the Samba files_struct structure
AIO Handling in a VFS Module
Conforming to the VFS Interfaces
Be prepared for "stat" opens
Things to watch out for
Samba Version VFS Differences
Some Existing VFS Modules
Building, Installing and Debugging your VFS Module