disign of the VFS modules

Alexander Bokovoy a.bokovoy at sam-solutions.net
Tue Nov 26 10:12:00 GMT 2002


On Tue, Nov 26, 2002 at 09:27:13AM +0100, Stefan (metze) Metzmacher wrote:
> Hi Jelmer,
> 
> I noticed that most vfs modules use global vars, I think we should avoid 
> this because the modules are configurable for each share (connection). and 
> the modules should use a connection context to store the configuration data 
> to not conflict,
> 
> I'm currently writing a vfs_antivir module and store the configuration data 
> in conn->vfs_private...
> 
> Comments?
vfs_private was designed for it. Modules which use global vars should be
fixed, indeed, I've tried to do so during introduction of stacked VFS. 

But in current CVS HEAD we have a number of misuse of vfs_private, for
example, in vfs_recycle, which uses conn->vfs_private as (void*) storage
of its own data instead of storing that data in vfs_handle->data
passed at vfs_init() stage.

So, this is should also be fixed. And module should not directly access
conn->vfs_private as it may correspond to different module
(conn->vfs_private is a list of handles actually). Instead,
vfs_handle passed at vfs_init() stage should be stored somewhere and
referenced later.
-- 
/ Alexander Bokovoy
---
byob, v:
	Believing Your Own Bull



More information about the samba-technical mailing list