Questions regarding vfs module development and memcache

Jeremy Allison jra at
Thu Jun 16 22:12:19 UTC 2016

On Tue, Jun 14, 2016 at 12:50:04PM -0600, Trever L. Adams wrote:
> On 06/10/2016 04:21 PM, Jeremy Allison wrote:
> > On Fri, Jun 10, 2016 at 08:44:03AM -0600, Trever L. Adams wrote:
> >> Regarding my work on One
> >> of the todo items is to move away from his own caching system for the
> >> scan results to Samba's memcache. The problem with this is that the
> >> information contains to variable length members: the file name and the
> >> scan report.
> >>
> >> I know I can talloc an object that is the datastructure (with the
> >> lengths for those) + the needed space and memcpy, or similar, the data
> >> into that object.
> >>
> >> I am using my own privately declared memcache, but the memcache_number
> >> is of concern. I am assuming I need to use a TALLOC type. The only thing
> >> that makes sense is SINGLETON_CACHE_TALLOC. Based on the code, it
> >> appears I can use anything that is a TALLOC type.
> > Add a new memcache_number inside lib/util/memcache.h.
> > Look at the code that added a new cache type:
> >
> > git show 60fbfc5563ada64ea145e93ceaee791165d78e64..13b6199a2fd47dd96166878f861f2ae56d2b4a45
> >
> Fantastic, thank you. I have cleaned up my code even more now that I am
> understanding all that talloc and company do as well as memcache. I do
> not know when/if (other than it was a stated TODO) the main author of
> the vfs module will merge, so I have checked to see if the enum contains
> the value I am including a patch for. If it does, it is used, if it
> isn't then the SINGLETON_CACHE_TALLOC is used. As I do not have any
> accounts (at least not that I remember and certainly not
> commit access) can you help me get this patch committed?
> Thank you for all of your help Jeremy! Hopefully people will find the
> work I have done on the samba_virusfilter vfs useful.
> Again, thank you,

No problem. But I don't want to add this change to memcache.c
until the code that uses it is also merged.

Are you planning to submit the VFS module also ?

More information about the samba-technical mailing list