enter image description here

I came across this picture when learning samba. I am confused with the VFS module in this image.

  1. Why we need this VFS module in samba server instead of passing directly the intend system call to the C library? I understand in the client side we need a cifs.ko or smbfs for the kernel to understand the mounted file system.

    For example, when the client wants to read a file. It passes the corresponding protocol command to the server over network. And the server's Ethernet card will receive it and transmit to application layer. Then the CIFS protocol in the application layer will interpret this command and passes it to the c library which will eventually lead to the sys_read() system call. And in this procedure the VFS seems unnecessary.

  2. Is this module obligatroy? If not, how can I check if it is compiled?



The picture aims to describe the smbd process architecture. It want to express that smbd has a multi-process and single thread architecture. I saw this in an article that compare the Samba 3.0 and another CIFS server called Likewise.

  • Can you tell us where the picture comes from and what it was supposed to convey?
    – Fred Foo
    Oct 7, 2011 at 15:56
  • Hi @larsmans, sorry for not make that clear. I've already modify that, please see the supplement parts. Thanks
    – sliter
    Oct 7, 2011 at 18:33

5 Answers 5


4 hours without any answer, so I'll add my guess: This might be a layer that translates physical paths (like /var/samba/share1/dir/file) into logical (share1\dir\file), together with necessary file name conversions, permission checks and so on. As such it is necessary and not optional.

Protocol implementation by itself might be something which already operates on the logical paths and simply puts whatever it can find in the VFS onto a wire.


It is not entirely clear what the diagram is meant to show. But all file system calls in Linux are handled by the VFS. In that sense the VFS is the bit of the kernel that services the system calls. But like you I am not sure why the diagram says VFS makes a blocking syscall.

But your explanation is also incorrect. If by client you mean something at the application layer then Samba should be transparent. It just thinks it is accessing another filesystem and will use the standard syscalls to do that (ie through VFS). The kernel would then route these calls through the network.


I think VFS modules extend the functionality of a posix file system.


For example support for extended attributes for a particular file system is optional. However you can selective enable/ disable it.


Like Vink said, the VFS modules add functionality. Here are some examples. You can add a

  • virus scanner module which scans each file as it is being written,

  • recycling bin module which moves all deleted files to a recycling bin instead of deleting them

  • Auditing module which logs all access to the files so who touched what can be determined.

  • ceph filesystem module which directly connects the share to the ceph distributed file system without having to locally mount the ceph structure on that machine.

  • etc...

Additionally these modules can be stacked, thus combining their functionalities.


The VFS module a layer of abstraction that provides a consistent interface to different file system implementations.

Virtual file system

A virtual file system (VFS) or virtual filesystem switch is an abstraction layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. ...

SAMBA and all user-space processes need the VFS module in order to get to the actual file systems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .