diff options
author | Ira Cooper <ira@wakeful.net> | 2011-08-19 10:32:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-08-20 01:15:07 +0200 |
commit | f6e3484ba6350204cee0e0a85500b5ebb22fa4db (patch) | |
tree | bc47e832319e486eef10b7b8055d8dfb7ae3454d | |
parent | c21c25450819c9bf2d88c52e6ba44df2c28a01a4 (diff) | |
download | samba-f6e3484ba6350204cee0e0a85500b5ebb22fa4db.tar.gz samba-f6e3484ba6350204cee0e0a85500b5ebb22fa4db.tar.bz2 samba-f6e3484ba6350204cee0e0a85500b5ebb22fa4db.zip |
Re-arrange the optimization to reduce tdb fcntl calls if smbd is not
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
-rw-r--r-- | source3/lib/serverid.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index e5532756e8..d567066a16 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -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; } |