Inconsistent naming of vfs_read in the VFS Function pointer structure ...

Richard Sharpe realrichardsharpe at gmail.com
Sat Nov 26 15:47:44 MST 2011


On Sat, Nov 26, 2011 at 2:42 PM, Christopher R. Hertel
<christopher.hertel at gmail.com> wrote:
> simo wrote:
>> On Sat, 2011-11-26 at 13:19 -0800, Richard Sharpe wrote:
>>> Hi folks,
>>>
>>> I came across this:
>>>
>>>         /* File operations */
>>>
>>>         .open_fn = vfswrap_open,
>>>         .create_file = vfswrap_create_file,
>>>         .close_fn = vfswrap_close,
>>>         .vfs_read = vfswrap_read,
>>>         .pread = vfswrap_pread,
>>>         .write = vfswrap_write,
>>>         .pwrite = vfswrap_pwrite,
>>>         .lseek = vfswrap_lseek,
>>>
>>> Is there any reason that it is vfs_read and not just read?
>>
>> It may be for the same reason we had to change open -> open_fn, because
>> glibc at some point made open() into a macro. It is possible the same
>> happened for read() I guess, on some platform.
>>
>> Granted, maybe using read_fn would have been more consistent :)
>
> Why not rename them all to end in _fn?

I thought briefly about that, and it would be relatively easy with a
SED script or something, but the churn would be horrible for little
real benefit.

-- 
Regards,
Richard Sharpe


More information about the samba-technical mailing list