Add a in-memory cache
[nivanova/samba-autobuild/.git] / source3 / smbd / server.c
index 41d036a8b91e76fc0d86581a59747de5e8485615..574197d7113796aa7d055b5f04c0f737f8b2cad6 100644 (file)
@@ -86,6 +86,19 @@ struct messaging_context *smbd_messaging_context(void)
        return ctx;
 }
 
+struct memcache *smbd_memcache(void)
+{
+       static struct memcache *cache;
+
+       if (!cache
+           && !(cache = memcache_init(NULL,
+                                      lp_max_stat_cache_size()*1024))) {
+
+               smb_panic("Could not init smbd memcache");
+       }
+       return cache;
+}
+
 /*******************************************************************
  What to do when smb.conf is updated.
  ********************************************************************/