Re-arrange the optimization to reduce tdb fcntl calls if smbd is not
authorIra Cooper <ira@wakeful.net>
Fri, 19 Aug 2011 17:32:29 +0000 (10:32 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 19 Aug 2011 23:15:07 +0000 (01:15 +0200)
clustered. procid_is_me() is much cheaper to test and can optimize
up to 50% of the calls to serverid_exists(). Volker please check.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Aug 20 01:15:07 CEST 2011 on sn-devel-104

source3/lib/serverid.c

index e5532756e83dc86d029d3b5a33ee9949b02a03d4..d567066a1646e7eecdd87cf3d1dc8dc7837832e0 100644 (file)
@@ -236,7 +236,11 @@ bool serverid_exists(const struct server_id *id)
        struct serverid_key key;
        TDB_DATA tdbkey;
 
-       if (lp_clustering() && !process_exists(*id)) {
+       if (!lp_clustering() && procid_is_me(id)) {
+               return true;
+       }
+
+       if (!process_exists(*id)) {
                return false;
        }