I have a need to know the requested VFS interface version inside a VFS module. With this I can write code which accepts older VFS interface versions, and simply dumbs down the functionality of the module to fit the interface. If a higher version number is passed, the module supplies more functionality.
For this reason, I am suggesting the version level of the VFS inferface be passed in both directions. If the module rejects it, the module can pass back -1. If the module supports it, it can pass back the level it supports. When both sides accept the other's level of support, the module loading will succeed. This also helps alleviate version number collisions. I had already gone to level 3, to support another change. A recent change by the Samba team caused the native version level to also go to 3, and I needed a way to tell the two interface types apart, even though I support both. Now I changed my own VFS level to 4, and support 3 and 4 in the module. That way the module still works with plain Samba. Fortunately, it's a real simple change: Index: vfs.c =================================================================== RCS file: /cvsroot/samba/source/smbd/vfs.c,v retrieving revision 1.16.2.38 diff -a -u -c -r1.16.2.38 vfs.c cvs server: conflicting specifications of output style *** vfs.c 16 Apr 2002 14:56:31 -0000 1.16.2.38 --- vfs.c 21 May 2002 19:12:14 -0000 *************** *** 131,137 **** static BOOL vfs_init_custom(connection_struct *conn) { ! int vfs_version = -1; struct vfs_ops *ops, *(*init_fptr)(int *, struct vfs_ops *); DEBUG(3, ("Initialising custom vfs hooks from %s\n", lp_vfsobj(SNUM(conn)))); --- 131,137 ---- static BOOL vfs_init_custom(connection_struct *conn) { ! int vfs_version = SMB_VFS_INTERFACE_VERSION; struct vfs_ops *ops, *(*init_fptr)(int *, struct vfs_ops *); DEBUG(3, ("Initialising custom vfs hooks from %s\n", lp_vfsobj(SNUM(conn)))); -- Andrew C. Esh mail:Andrew.Esh[at]tricord.com