VFS Layer

William234 at aol.com William234 at aol.com
Mon Aug 13 14:03:25 GMT 2001


I have been working with writing a VFS module based on the auditing example.  In doing so, I kept getting a lot of internal panics in Samba, and as near as I could trace it down, the problem came when the VFS module would try to call the disk IO functions back in the smbd daemon.  The data would get corrupted.

I started working on changes so that the file IO routines in smbd would get called and then the routine would call the VFS module.  Thus reducing the amound of pointer passing required.  This may make "Stackable" VFS modules easier as well, as you won't have vfs module 1 calling module 2 calling modules 3, calling smbd.

you would do something along the lines of

for(l = 0; l < MAX_VFS_MODS; l++)
  if(conn->vfs_ops.open[l] != NULL)

Some of the changes I've made are:

Remove vfs_init_default as it should not be needed.

I've added a header file called vfs_macros.h because it is dependent on function prototypes that are declared in proto.h, and since smb_macros.h comes before proto.h, the vfs_* macros wouldn't function properly.

I added a line to #include vfs_macros.h just below smb.h to solve the prototype problem.

This will require changing the return type of the vfs modules to void rather then int or DIR * as they presently are.

I have not done too much testing.  I do know that you can connect to smbd and get a directory listing in its current state. I had to make some changes to posix.c which broke the ability to compile things like swat so I need to fix that and keep testing.

I have to say that this is the first time i've ever looked at the Samba code, and I'm not the strongest UNIX programmer.  I like constructive criticism.  I do not want to start or be involved in a flame war.

Bill Miller
William234 at aol.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba221mods.tgz
Type: application/octet-stream
Size: 8983 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20010813/1705987d/samba221mods.obj

More information about the samba-technical mailing list