Making VFS Function pointer names more consistent

Richard Sharpe realrichardsharpe at gmail.com
Sat Dec 3 17:00:10 MST 2011


Hi folks,

I have started working on making them all consistently <function_name>_fn.

In doing so, I changed VFS_FIND slightly to:

#define VFS_FIND(__fn__) while (handle->fns->__fn__##_fn==NULL) { \
                                handle = handle->next; \
                         }

but this requires smbd/vfs.c to have code like:

int smb_vfs_call_open(struct vfs_handle_struct *handle,
                      struct smb_filename *smb_fname, struct files_struct *fsp,
                      int flags, mode_t mode)
{
        VFS_FIND(open);
        return handle->fns->open_fn(handle, smb_fname, fsp, flags, mode);
}

where "open" is used for VFS_FIND but the function is called via
"open_fn", which is a small amount of additional inconsistency, and
might cause unneeded postings on the mailing lists.

It struck me that that it might also be possible to define a macro
that would eliminate the need to explicitly code the second line in
all these functions, but then we might be at the mercy of the C
preprocessors people are using.

Does anyone have any strong feelings one way or the other?

That is:

1. Is it worth exploring a macro of the sort CALL_VFS_FN(fn_name,
params ...) that would eliminate the need for the explicit call of the
function above, and

2. I think it is probably worth while using <fn_name>_fn explicitly
both in VFS_FIND and the call if 1 is not wanted.

-- 
Regards,
Richard Sharpe


More information about the samba-technical mailing list