Questions regarding vfs module development and memcache

Trever L. Adams trever at middleearth.sapphiresunday.org
Tue Jun 14 18:50:04 UTC 2016


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 https://github.com/fumiyas/samba-virusfilter/. 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
samba.org 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,

Trever

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SVF_SCAN_RESULTS_CACHE_TALLOC.patch
Type: text/x-patch
Size: 875 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160614/9bacea22/SVF_SCAN_RESULTS_CACHE_TALLOC.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160614/9bacea22/signature.sig>


More information about the samba-technical mailing list