VFS Question: Is there more vfs_ops ...( difference between vfs.c/vfs-wrap.c )

troutb at abclabs.com troutb at abclabs.com
Tue May 14 08:31:02 GMT 2002

Whats the difference between vfs.c & vfs-wrap.c ... the code doesn't have
many  comments.

Why would I put code into vfs-wrap.c ... wouldn't future upgrades go easier
if it was a vfs modules?
Or does that limit the cmds & funtions you have?
Can I get the workstation that made the connection?

Is there any documentation on this subject?

> On Fri, 2002-05-10 at 17:12, troutb at abclabs.com wrote:
>> I want to make a cp instead of rename when a file is open for rewrite
>> is there a default_vfs_ops.cp ?
>> or can I just make my own calls ?
>> can I write the file somewhere is on the file system?
>> I'm new at this, but would like to help out the cause while I help
>> myself.
>> Basically, I trying to create a feautre that would do versioning ..
>> most likely in seperate read only location.
>> help ?
> What you probably want to do is create a vfs module that only takes
> care of rename.  Your module's rename function (your_rename())will look
> quite similar to source/smbd/vfs-wrap.c's vfswrap_rename(), except that
> it will always call copy_reg() and will never call rename() (except for
> perhaps when you are creating your backup copy).  Be sure to handle the
> case of a directory rename gracefully... do you really want to do
> version control when someone renames w:\win98_cd to w:\win98_sr2?
> If you need extra calls to be called from within your_rename(), you can
> define them within your vfs module, just as copy_reg() is defined in
> vfs-wrap.c.  Just be sure to make any extra functions that you declare
> static else they may have symbol conflicts with existing samba code or
> future vfs modules.
> Note, however, that for a function to be called directly from smbd, it
> must be referenced in your module's vfs_ops structure.  For example,
> when using the default vfs functions, vfs_ops->rename() is really
> vfswrap_rename().  copy_reg() is only called from within
> vfswrap_rename().
> Mike

More information about the samba-technical mailing list