RAID VFS module SoC project

Jiri Klouda jk at zg.cz
Mon Jun 5 00:25:12 GMT 2006


Hi Ming,
I am a co-mentor on your application. I am not going to be much help
with the RAID part, but if you have any questions about the VFS layer,
I have been working with it for a while now and feel free to ask anything.

Some initial pointers:

- You really want to use talloc for memory allocations: http://talloc.samba.org/
- There are two skeleton files for new VFS modules skel_opaque.c, which is
  likely your case, and skel_transparent.c. You can find both in examples/VFS
- You should look at example of working VFS modules in sources/modules/
  Most of these are example of transparent modules though, there is not really
  a good example of opaque module directly in the code.
- Include files source/include/vfs.h (vfs_handle_struct) and
  source/include/smb.h (connection_struct, files_struct, user_struct)

What you can learn from these are:
- The basic VFS module structure
- The data segment and use of talloc for memory allocation
- The handle and connection structures
- SMB_VFS_HANDLE_* macros
- Passing arguments from samba config file to your module.
- DEBUG macro is your friend

I strongly suggest to use the DEBUG macro with input arguments
at the start of every VFS call and with results at the end of each call
besides standard debug messages. If you defined DBGC_CLASS as
DBGC_VFS you can easily set the log level for just vfs modules in
your samba config file.

Also, when testing the VFS module, you could use the CIFS client
code or the smbfs. I found the CIFS to be better, especially since the
smbfs has some issues and is not supported anymore. But you really
want to put the CIFS client on a different machine than your server if
that is possible because it sometimes brings down the kernel. So you
can have the samba server on a stable machine and the client on some
throwaway client machine with all journaling filesystems.

Beyond this point I will be mostly passive, just responding to your
questions and trying to help you through any problems you might run
into on your way, but I expect the communication to be initiated by you.

Regards,
-Jiri

-- 
Jiri Klouda <jk at zg.cz>
http://www.zg.cz/~jk


More information about the samba-technical mailing list