summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib/tevent/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/tdr/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/socket_wrapper/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/nss_wrapper/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-0211-0/+11
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/compression/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: fix const warningsStefan Metzmacher2014-04-024-6/+13
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/util: declare smb_panic_default() as _NORETURN_Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/wscript: maintain a global list of unit testsStefan Metzmacher2014-04-021-45/+32
| | | | | | | This makes sure a new test is also added to 'make test' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/test: avoid const warnings by using 'discard_const_p(uint8_t,' instead ↵Stefan Metzmacher2014-04-0218-34/+34
| | | | | | | of '(void *)' Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/test: remove "\n" in diag() argumentsStefan Metzmacher2014-04-022-2/+2
| | | | | | | diag() already adds "\n". Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/test: always call fflush() after [f]printf() in tap-interface.hStefan Metzmacher2014-04-021-4/+22
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb/tools: avoid const warnings in tdbdump.cStefan Metzmacher2014-04-021-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb: don't alter errno on success of tdb_open_ex()Stefan Metzmacher2014-04-021-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/zlib: make use of conf.CHECK_BUNDLED_SYSTEM()Stefan Metzmacher2014-04-021-28/+23
| | | | | | | This way --bundled-libraries=ALL will use the internal zlib version. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tdb_wrap: Remove tdb_wrap_open_ againVolker Lendecke2014-03-313-37/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_tdbVolker Lendecke2014-03-311-2/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: Add lpcfg_tdb_flags()Volker Lendecke2014-03-312-1/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: Add lpcfg_tdb_hash_size()Volker Lendecke2014-03-311-0/+18
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add interim tdb_wrap_open_ without lp_ctxVolker Lendecke2014-03-312-21/+31
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Pull up lp_ctx use one levelVolker Lendecke2014-03-311-19/+19
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: let is_ipaddress_v6() cope with "fe80::1234%3"Stefan Metzmacher2014-03-251-12/+54
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:param: move lp_ctdbd_socket() to ctdbd_conn.cStefan Metzmacher2014-03-241-1/+1
| | | | | | | This allows us to use CTDB_PATH only in ctdbd_conn.c Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tdb: change version to 1.2.13.tdb-1.2.13Michael Adam2014-03-182-1/+68
| | | | | | | | | | | | | | | | * internal code cleanups * always open internal TDBs with incompatible hash * avoid reallocations in locking code * systematize output format in tdbtool dump * reduce freelist contention when allocating new records - try to find dead records also in other chains - don't do blocking locks on the freelist Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Mar 18 15:42:48 CET 2014 on sn-devel-104
* tdb: Reduce freelist contentionVolker Lendecke2014-03-183-30/+93
| | | | | | | | | | | | | | | | | | | | | | | In a metadata-intensive benchmark we have seen the locking.tdb freelist to be one of the central contention points. This patch removes most of the contention on the freelist. Ages ago we already reduced freelist contention by using the even much older DEAD records: If TDB_VOLATILE is set, don't directly put deleted records on the freelist, but just mark a few of them just as DEAD. The next new record can them re-use that space without consulting the freelist. This patch builds upon the DEAD records: If we need space and the freelist is busy, instead of doing a blocking wait on the freelist, start looking into other chains for DEAD records and steal them from there. This way every hash chain becomes a small freelist. Just wander around the hash chains as long as the freelist is still busy. With this patch and the tdb mutex patch (following hopefully some time soon) you can see a heavily busy clustered smbd run without locking.tdb futex syscalls. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Make "tdb_purge_dead" internally publicVolker Lendecke2014-03-182-1/+2
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Make "tdb_find_dead" internally publicVolker Lendecke2014-03-182-3/+6
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Add "last_ptr" to tdb_find_deadVolker Lendecke2014-03-181-4/+13
| | | | | | | | Will be used soon to unlink a dead record from a chain Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Move adding tailer space to tdb_find_deadVolker Lendecke2014-03-181-3/+4
| | | | | | | | | This aligns the tdb_find_dead API with the tdb_allocate API and thus makes it a bit easier to understand, at least for me. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Do a best fit search for dead recordsVolker Lendecke2014-03-181-7/+13
| | | | | | | | | | Hash chains are (or can be made) short enough that a full search for the best-fitting dead record is feasible. The freelist can become much longer, there we don't do the full search but accept records which are too large. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Don't purge records to a blocked freelistVolker Lendecke2014-03-181-1/+4
| | | | | | | | If the freelist is heavily contended, we should avoid accessing it Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tdb: Fix a tdb corruptionVolker Lendecke2014-03-181-2/+5
| | | | | | | | | | tdb_purge_dead can change the next pointer of "rec" if we purge the record right behind the current record to be deleted. Just overwrite the magic, not the whole record with stale data. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/popt: Patch memory leak in popthelp.cJose A. Rivera2014-03-131-2/+2
| | | | | | | | | | | Memory created as "t" was not being free'd. Change-Id: I5f6e20acc6c440a1cd9908aed7a90de2000f22f8 Coverity-Id: 240599 Coverity-Id: 240600 Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* lib/popt: Small whitespace fix for readability.Jose A. Rivera2014-03-131-14/+15
| | | | | | | Change-Id: Ib920f7e84c0247a8f09aa4c79c65b26afb78f234 Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* param: remove lp_dnsdomain from s3Garming Sam2014-02-201-1/+0
| | | | | | | | | With the use of the shared globals structure, lp_dnsdomain is no longer used in the code and removing it would remove a notable special case Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I59526c40c58e132a134d67fa7944dfeacd05f4c6 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: change s3_param.h from a generated file to a static oneGarming Sam2014-02-202-6/+21
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I131e37ec92f7a826caec382023915c5e4b4c52be Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* param: use loadparm_globals struct instead of lp function pointers in s3_helpersGarming Sam2014-02-202-18/+5
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: I4507cdbf111b7f9dca3ca18ee2bf242ffdfeb4e7 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* lib/param: rename lp_string to lpcfg_stringGarming Sam2014-02-201-9/+9
| | | | | | | | | This avoids the confusion with lp_string in source3. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: Ic6df23b9e5986f7d1fd6253e30ebfdc1a3a45a41 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* lib/param: handle non-constant strings properly by passing in a memory contextGarming Sam2014-02-201-8/+22
| | | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Change-Id: Ic6bb1c709defd2b0f35fc7b877da0badca385776 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
* build: find FILE_OFFSET_BITS via arrayGustavo Zacarias2014-02-181-4/+7
| | | | | | | | | | | | | | | | | | | | | | | This makes cross-compiling happy, use a trick similar to autoconf's AC_CHECK_SIZEOF macro. Basically we make an array: static int array[1 - 2 * !(((long int)(sizeof(off_t))) < 8)]; This gives -1 multiplied by the negation of the condition (sizeof(off_t) < 8) cast to a long int. So if the condition is true it gives array[(-1 * 0)] (remember the condition is cast and negated) thus passing a build test with a 0-sized array. If it's false it gives array[(-1 * 1)] thus failing with a negative-sized array. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Feb 18 23:18:32 CET 2014 on sn-devel-104
* tdb: always open internal databases with incompatible hash.Michael Adam2014-02-151-0/+5
| | | | | | | | | | | This makes them more efficient due to better distribution of keys across hash chains. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Feb 15 08:26:07 CET 2014 on sn-devel-104
* tdb: in tdb_delete_hash, make lock/unlock bracket more obviousMichael Adam2014-02-151-1/+1
| | | | | | | | | | by using the same variable as hash as in the lock. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Feb 15 03:21:07 CET 2014 on sn-devel-104
* tdb: simplify tdb_delete_hash() a bitMichael Adam2014-02-141-12/+5
| | | | | | | | | | | | | | | | | | | | Make the lock/unlock bracket more obvious by extracting locking (and finding) from the special cases to the top of the function. This also lets us take lock and find the record outside the special case branches (use dead records or not). There is a small semantic change implied: In the dead records case, the record to delete is looked up before the current dead records are potentially purged. Hence, if the record to delete is not found, the dead records are also not purge. This does not make a big difference though, because purging is only delayed until directly befor the next record to delete is in fact found. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: tdbtool: dump record magic with fixed number of 8 hex digitsMichael Adam2014-02-141-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* tdb: tdbtool: dump record hash with fixed number of 8 hex digitsMichael Adam2014-02-141-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* waf:lib/replace fix iconv checks on HP/UXChristian Ambach2014-02-131-1/+1
| | | | | | | | | | | | | | | | | we need to copy away the list of LDFLAGS to be tried before modifying it instead of just creating a new reference and then continuing with a modified list while it should have been reset back to the original value Bug: https://bugzilla.samba.org/show_bug.cgi?id=9911 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Feb 13 02:01:03 CET 2014 on sn-devel-104
* param: Move LOADPARM_EXTRA_GLOBALS to lib/param/loadparm.h to be shared ↵Garming Sam2014-02-122-17/+17
| | | | | | | | between loadparms Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: move SMB2 defaults to lib/param and use in loadparm_initGarming Sam2014-02-122-4/+10
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: remove special cases for tls filesGarming Sam2014-02-122-16/+11
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: use generate_param.py to generate s3_param.hGarming Sam2014-02-121-3/+3
| | | | | | | Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>