Patch to export init_stat_ex_from_stat so that it can be used in VFS modules rather than duplicating code

Guenther Deschner gd at samba.org
Fri Jun 10 04:21:48 MDT 2011


Hi Richard,

On 06/09/2011 06:01 PM, Richard Sharpe wrote:
> On Thu, Jun 9, 2011 at 11:58 AM, Guenther Deschner<gd at samba.org>  wrote:
>> Hi RIchard,
>>
>> On 06/09/2011 01:24 AM, Richard Sharpe wrote:
>>>
>>> OK,
>>>
>>> Here is an updated version:
>>>
>>> Signed-off-by: Richard Sharpe<realrichardsharpe at gmail.com>
>>>
>>> From: Richard Sharpe<realrichardsharpe at gmail.com>
>>> Date: Fri, 3 Jun 2011 08:27:13 -0700
>>> Subject: [PATCH] Export init_stat_ex_from_stat for use in VFS modules.
>>>
>>> ---
>>>   source3/include/includes.h |    1 +
>>>   source3/include/proto.h    |   11 +++++++++++
>>>   source3/lib/system.c       |   12 ++++++------
>>>   3 files changed, 18 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/source3/include/includes.h b/source3/include/includes.h
>>> index e6b70c7..55a8e85 100644
>>> --- a/source3/include/includes.h
>>> +++ b/source3/include/includes.h
>>> @@ -72,6 +72,7 @@
>>>   #include "system/locale.h"
>>>   #include "system/time.h"
>>>   #include "system/wait.h"
>>> +#include "system/filesys.h"
>>
>> ^^^ please, please don't do that.
>>
>> It took us a long time to trim down the list of global includes (and make
>> includes.h more and more identical between s3 and s4) and you would just
>> re-add a whole bunch of globally included header files just in order to have
>> one additional prototype again globally available. This is how we did things
>> in the past but we should not continue to do it this way.
>>
>> A better way of resolving this would be to split out the prototypes of the
>> init_stat_ex_from_stat() call to a tiny separate header file for now, and
>> include it only where really needed.
>>
>> Does that make sense ?
>
> Well, it makes sense, but I am getting contradictory advice from
> different team members :-)

Ok, after looking at it again, I realized there is actually no need to 
add a global include at all. Adding forward declarations is absolutely 
sufficient here. Problem gone :-) I slightly modified your patch and 
pushed to autobuild.

Thanks for your patience,

Guenther

> There is bound to be more functions that are needed in VFS modules and
> there may already be some that have been placed in proto.h ...

Hm, I think we trimmed down proto.h right now to only include lib/, 
param/ and some libsmb/ related prototypes. All vfs module protos have 
been moved out already.


-- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org


More information about the samba-technical mailing list