Difference between revisions of "Writing a Samba VFS in Samba 3.6 and earlier"

(Introduction)
(Introduction)
Line 9: Line 9:
 
# Provides more detail on actually writing a Samba VFS and some of the functions and macros Samba makes available to help you.
 
# Provides more detail on actually writing a Samba VFS and some of the functions and macros Samba makes available to help you.
 
# Introduces some existing VFS modules, especially in the context of the two file system types outlined above.
 
# Introduces some existing VFS modules, especially in the context of the two file system types outlined above.
 +
# Lists differences in the VFS for different versions of Samba.
 
# Gives details on the steps module writes will have to take to add their code and build their module.
 
# Gives details on the steps module writes will have to take to add their code and build their module.
 
# Provides some information on adding additional VFS routines over and above those already provided.
 
# Provides some information on adding additional VFS routines over and above those already provided.

Revision as of 05:05, 6 May 2014

Introduction

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:

  1. 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.
  2. Discusses two different types of file systems that module writers might want to write a VFS module for.
  3. Provides more detail on actually writing a Samba VFS and some of the functions and macros Samba makes available to help you.
  4. Introduces some existing VFS modules, especially in the context of the two file system types outlined above.
  5. Lists differences in the VFS for different versions of Samba.
  6. Gives details on the steps module writes will have to take to add their code and build their module.
  7. Provides some information on adding additional VFS routines over and above those already provided.

The Samba VFS

Two Types of File Systems

Samba-vfs-diag-1.gif


Samba-vfs-diag-2.gif

Writing a VFS Module

VFS Module Initialization

VFS Function Pointer Structure

Include Files

VFS Functions

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

TBD

Samba Version VFS Differences

TBD

Some Existing VFS Modules

TBD

Building, Installing and Debugging your VFS Module

TBD

Adding New VFS Routines