From 6c55518d471950d8ebaf0df47634116802d6f735 Mon Sep 17 00:00:00 2001 From: Steven Danneman Date: Wed, 26 Aug 2009 16:17:38 -0700 Subject: s3/smbd: open the share_info.tdb on startup instead of tconx This is a small performance optimization. Instead of opening the tdb on every smb connection in the forked child process, we now open it in the parent and share the fd. This also reduces the total fd usage in the system. --- source3/smbd/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/smbd') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index ace3124842..09ad8d8ea5 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1218,6 +1218,15 @@ extern void build_options(bool screen); return -1; } + /* Open the share_info.tdb here, so we don't have to open + after the fork on every single connection. This is a small + performance improvment and reduces the total number of system + fds used. */ + if (!share_info_db_init()) { + DEBUG(0,("ERROR: failed to load share info db.\n")); + exit(1); + } + /* only start the background queue daemon if we are running as a daemon -- bad things will happen if smbd is launched via inetd and we fork a copy of -- cgit