Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

Thanks

Supplement:

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.

share|improve this question

migrated from stackoverflow.com Oct 10 '11 at 10:52

This question came from our site for professional and enthusiast programmers.

    
Can you tell us where the picture comes from and what it was supposed to convey? –  larsmans Oct 7 '11 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 '11 at 18:33

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.