Suggestion for change in the vfs_ops structure?

Kris Van Hees aedil at
Wed Nov 13 04:12:01 GMT 2002

On Tue, Nov 12, 2002 at 09:20:59PM -0500, Kris Van Hees wrote:
> Could the passed filenames and pathnames in the functions in vfs_ops be made
> non-const?  The use of a VFS module as transparent layer includes the ability
> to change the passed data (as suggested from the comments in vfs.h), but with
> the const qualifiers there, you cannot legally change the passed names without
> generating compiler warnings.

Actually, looking into this further, perhaps we'd be better served with adding
a new function to the VFS api, char *vfs_translate(const char *) which takes a
pathname and returns a possibly rewritten version of it.  The default would be
simply returning the pathname itself.

This can be used in operations such as when calling get_lanman2_dir_entry()
from call_trans2findfirst() to ensure that cached directory information can be
matched.  The main purpose (right now) is to support @sys resolving for AFS,
so that e.g. d- at sys gets translated to d-i386_win2k and as such can be found to
match a directory entry by that name.


PS: As Andrew responded before I finished this update, allowing the various VFS
    functions to change the passed in filename would be very dangerous.

More information about the samba-technical mailing list