summaryrefslogtreecommitdiff
path: root/lib/util/memcache.c
AgeCommit message (Collapse)AuthorFilesLines
2026-03-01lib: Remove the "getwd cache"Volker Lendecke1-1/+0
No longer needed Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2023-10-27lib:util: Add a gfree_memcache()Andreas Schneider1-0/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-27lib:util: Add boolean return type for memcache_add_talloc()Andreas Schneider1-3/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-27lib:util: Add boolean return type for memcache_add()Andreas Schneider1-5/+7
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-02-03lib:util: Avoid free'ing our own pointerAndreas Schneider1-4/+15
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14625 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Feb 3 10:57:01 UTC 2021 on sn-devel-184
2019-04-06memcache: Properly track the size of talloc objectsChristof Schmitt1-0/+19
With memcache_add_talloc, the talloc object becomes part of the pool and the memcache_element stores a pointer to the talloc object. The size of the the talloc object was not used when tracking the used space, allowing the cache to grow larger than defined in the memcache_init call. Fix this by adding the size of the talloc object to the used space. Also record the initial size of the talloc object for proper adjustment of the used space in the cache later. This is in case the size of the talloc object is modified while being owned by the cache (e.g. allocating talloc child objects). This should never happen, but better be safe than ending up with a broken cache usage counter. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13865 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-04-06memcache: Introduce struct for storing talloc pointerChristof Schmitt1-15/+20
This allows extending the additional data stored for talloced objects later. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13865 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-24Samba-VirusFilter: memcache changes.Trever L. Adams1-0/+1
Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-01s3: VFS: Change SMB_VFS_GETWD to return struct smb_filename * instead of char *.Jeremy Allison1-0/+1
We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2015-04-17lib: memcache. Add a new talloc cache type - SHARE_MODE_LOCK_CACHE.Jeremy Allison1-0/+1
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-11lib/util: Include DEBUG macro in internal header files before samba_util.hLukas Slebodnik1-1/+1
It's best practice to include external header files before internal header files. In this case internal DEBUG macro cannot be defined and therefore samba version of debug macro will be included in header file "util/fault.h". In file included from example.c:27:0: src/util/util.h:127:0: error: "DEBUG" redefined [-Werror] #define DEBUG(level, format, ...) do { \ ^ In file included from /usr/include/samba-4.0/util/fault.h:29:0, from /usr/include/samba-4.0/samba_util.h:62, from /usr/include/samba-4.0/ndr.h:30, from example.c:24: /usr/include/samba-4.0/util/debug.h:182:0: note: this is the location of the previous definition #define DEBUG( level, body ) \ ^ CC src/providers/ad/libsss_ad_common_la-ad_domain_info.lo cc1: all warnings being treated as errors BUG: https://bugzilla.samba.org/show_bug.cgi?id=11033 Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 11 18:47:22 CET 2015 on sn-devel-104
2014-07-18lib/util: move memcache.[ch] to the toplevel 'samba-util' libraryStefan Metzmacher1-0/+421
This is generic enough that it could be used in all code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jul 18 15:43:33 CEST 2014 on sn-devel-104