summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-18 09:41:03 +0100
committerVolker Lendecke <vl@samba.org>2007-12-18 09:56:04 +0100
commitf427d4ce65659419c8989d87acd97d00b4db41e6 (patch)
tree382dce7bf0150c284b84d822e3d1c8c037fb0281 /source3/param
parent68e65b29815f1f9bbe7384e07fc341f6c8f2f605 (diff)
downloadsamba-f427d4ce65659419c8989d87acd97d00b4db41e6.tar.gz
samba-f427d4ce65659419c8989d87acd97d00b4db41e6.tar.bz2
samba-f427d4ce65659419c8989d87acd97d00b4db41e6.zip
Add a in-memory cache
This is a more general API that caches data with a LRU scheme. See include/cache.h. No comments yet, I'm still working on it. But Jeremy has given me a hint in one of his checkins that he would like to make use of this now. The idea is that we get rid of all our silly little caches and merge them all into one cache that we can then very easily trim, for example even with a smbcontrol message if someone decides memory is tight. The main user is the stat cache, this patch also converts the getwd cache. More caches to come. (This used to be commit 7a911b35713538d82001a3c9f34152e293fe1943)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 881bcece7c..eea3ecec2b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -88,8 +88,6 @@ static bool include_registry_globals = False;
#define USERSHARE_VALID 1
#define USERSHARE_PENDING_DELETE 2
-bool use_getwd_cache = True;
-
extern int extra_time_offset;
static bool defaults_saved = False;
@@ -215,6 +213,7 @@ typedef struct {
int pwordlevel;
int unamelevel;
int deadtime;
+ bool getwd_cache;
int maxprotocol;
int minprotocol;
int security;
@@ -1037,7 +1036,7 @@ static struct parm_struct parm_table[] = {
{"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
{"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED},
- {"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED},
+ {"getwd cache", P_BOOL, P_GLOBAL, &Globals.getwd_cache, NULL, NULL, FLAG_ADVANCED},
{"keepalive", P_INTEGER, P_GLOBAL, &Globals.iKeepalive, NULL, NULL, FLAG_ADVANCED},
{"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE },
{"directory name cache size", P_INTEGER, P_LOCAL, &sDefault.iDirectoryNameCacheSize, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE },
@@ -1535,6 +1534,7 @@ static void init_globals(bool first_time_only)
Globals.pwordlevel = 0;
Globals.unamelevel = 0;
Globals.deadtime = 0;
+ Globals.getwd_cache = true;
Globals.bLargeReadwrite = True;
Globals.max_log_size = 5000;
Globals.max_open_files = MAX_OPEN_FILES;
@@ -2023,6 +2023,7 @@ FN_GLOBAL_INTEGER(lp_maxmux, &Globals.max_mux)
FN_GLOBAL_INTEGER(lp_passwordlevel, &Globals.pwordlevel)
FN_GLOBAL_INTEGER(lp_usernamelevel, &Globals.unamelevel)
FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime)
+FN_GLOBAL_BOOL(lp_getwd_cache, &Globals.getwd_cache)
FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol)
FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol)
FN_GLOBAL_INTEGER(lp_security, &Globals.security)