1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-31 12:23:52 +03:00
Commit Graph

128 Commits

Author SHA1 Message Date
Simo Sorce
1113d4caa7 r13773: Be consistent in the way you get out and free allocated data 2007-10-10 13:52:11 -05:00
Jelmer Vernooij
4599703914 r13651: Always make sure pkgconfig directory exists 2007-10-10 13:52:04 -05:00
Andrew Tridgell
a37d9434d1 r13283: added two optimisations to the tdb transactions code. The first is to
more agressively coalesce entries in the linked list of the undo
log. The second is to ensure that writes during a transaction into the
hash table don't cause the size of the undo log linked list to grow.

These optimisations don't affect Samba much, but they make a huge
difference to the use of ldb in kde
2007-10-10 13:51:42 -05:00
Jelmer Vernooij
b24f2583ed r12498: Eliminate INIT_OBJ_FILES and ADD_OBJ_FILES. We were not using
the difference between these at all, and in the future the
fact that INIT_OBJ_FILES include smb_build.h will be sufficient to
have recompiles at the right time.
2007-10-10 13:47:45 -05:00
Jelmer Vernooij
a86abe84e2 r12254: Add some (hopefully correct) descriptions for libraries that are installed.
Install pkg-config files.
2007-10-10 13:47:24 -05:00
Simo Sorce
22c8c97e6f r11567: Ldb API change patch.
This patch changes the way lsb_search is called and the meaning of the returned integer.
The last argument of ldb_search is changed from struct ldb_message to struct ldb_result
which contains a pointer to a struct ldb_message list and a count of the number of messages.
The return is not the count of messages anymore but instead it is an ldb error value.

I tryed to keep the patch as tiny as possible bu as you can guess I had to change a good
amount of places. I also tried to double check all my changes being sure that the calling
functions would still behave as before. But this patch is big enough that I fear some bug
may have been introduced anyway even if it passes the test suite. So if you are currently
working on any file being touched please give it a deep look and blame me for any error.

Simo.
2007-10-10 13:45:53 -05:00
Jelmer Vernooij
90f49b6f70 r11304: Add support back in for loading shared modules (not used yet) 2007-10-10 13:45:16 -05:00
Jelmer Vernooij
b4745032a2 r11303: Support defining and installing public headers for libraries.
Support installing libraries.
Get rid of pkg-config file (will be autogenerated later on).
2007-10-10 13:45:16 -05:00
Jelmer Vernooij
98d1f9b1dc r11300: Treat libraries as a special kind of subsystem
(one that can also be built as a library and installed).
2007-10-10 13:45:15 -05:00
Jelmer Vernooij
24e1030090 r11244: Relative path names in .mk files 2007-10-10 13:45:06 -05:00
Jelmer Vernooij
7fffc5c917 r11214: Remove scons files (see http://lists.samba.org/archive/samba-technical/2005-October/043443.html) 2007-10-10 13:45:03 -05:00
Andrew Tridgell
ef020d599f r10893: add configure test for utime (needed for the previous utime patch) 2007-10-10 13:39:40 -05:00
Andrew Tridgell
b2934732dd r10891: I noticed that the secrets.db was not being backed up on my system due
to msync/mmap not changing the mtime of the file. This patch ensures
that for successfully completed transactions we update the mtime.

I don't do this on all tdb writes as its too expensive, but doing it
just on transactions is bearable, as those cost quite a lot anyway.
2007-10-10 13:39:40 -05:00
Jelmer Vernooij
b53313dc51 r10586: Add MergedObject() builder. Default to Library() rather
then StaticLibrary()
2007-10-10 13:39:08 -05:00
Andrew Tridgell
f02a92787b r10524: SAFE_FREE() in tdb does not need the discard_const_p()
the discard_const_p() was causing problems on openbsd where intptr_t is not defined
2007-10-10 13:39:01 -05:00
Andrew Tridgell
54203aacd1 r10522: finally got the locking working on solaris10. This adds a read lock on
the transaction lock in tdb_traverse_read(). This prevents a pattern
of locks which triggers the deadlock detection code in solaris10. I
suspect solaris10 is trying to prevent lock starvation by granting
locks in the order they were requested, which makes it much easier to
produce deadlocks.
2007-10-10 13:39:00 -05:00
Andrew Tridgell
11739ad31d r10496: - added configure test for sys/time.h
- print length of failed locks
2007-10-10 13:38:56 -05:00
Andrew Tridgell
a11762e7bc r10495: older redhat boxes need sys/time.h for select() 2007-10-10 13:38:56 -05:00
Andrew Tridgell
1b03c4e6c7 r10494: - don't generate a tdb log message for any type of failed lock probe
- if the lock upgrade loop ever fails then log a warning
2007-10-10 13:38:55 -05:00
Andrew Tridgell
144cc3da5e r10493: we need sys/select.h to enable select() in the solaris workaround 2007-10-10 13:38:55 -05:00
Andrew Tridgell
980dd17f7d r10492: work around a bug in solaris which cases lock upgrades to fail with
EDEADLK even when progress can be made. This is not a good solution,
but I can't find anything better.
2007-10-10 13:38:55 -05:00
Andrew Tridgell
196995ea38 r10484: try to fix the pread/pwrite declaration problems 2007-10-10 13:38:53 -05:00
Andrew Tridgell
315653cf1e r10483: fixed some uninitialised variables warnings 2007-10-10 13:38:53 -05:00
Andrew Tridgell
a795fc0aa1 r10475: make sure we report failures in tdbtorture (ie. get the exit status right) 2007-10-10 13:38:51 -05:00
Andrew Tridgell
ab953c8c72 r10471: stratos doesn't have getpagesize(), so guess 8k on systems that don't
have it. Overestimating is harmless.
2007-10-10 13:38:51 -05:00
Andrew Tridgell
c85836bafc r10470: solaris8 has a problem with tdbtorture with 3 processes. To see if
this is just a solaris issue this patch changes the default to 3, and
I'll see how many build farm boxes break
2007-10-10 13:38:51 -05:00
Andrew Tridgell
fc692dc61f r10469: use the older style of structure initialisation for tdb to make it
more portable. tdb is used in more than just Samba4, and I think the
portability/readability balance is a bit different
2007-10-10 13:38:50 -05:00
Andrew Tridgell
c2b1739c63 r10468: - terminate tdbtorture quickly when an error is detected
- more workarounds for aix not handling malloc of size 0
2007-10-10 13:38:50 -05:00
Andrew Tridgell
0177c6ca3e r10467: aix doesn't like zero length malloc :( 2007-10-10 13:38:50 -05:00
Andrew Tridgell
e615f36733 r10466: work around missing pread/pwrite declaration on openbsd 2007-10-10 13:38:49 -05:00
Andrew Tridgell
294ccfd46a r10465: separate out a read_only db from a read-only traversal to ensure we
don't end up doing a mmap read only
2007-10-10 13:38:49 -05:00
Andrew Tridgell
d9ee0e8b59 r10463: consider it an error if tdbtorture produces any log messages 2007-10-10 13:38:49 -05:00
Andrew Tridgell
312491b251 r10462: cope better with compilers that don't put the object file in the same directory
as the source
2007-10-10 13:38:49 -05:00
Andrew Tridgell
83168c7e76 r10461: fixed tdb build on systems without stdint.h 2007-10-10 13:38:48 -05:00
Andrew Tridgell
bce35ad237 r10460: fixed portability of transaction code to systems with integer
alignment constraints (like sparc)
2007-10-10 13:38:48 -05:00
Andrew Tridgell
03942dd54b r10459: fixed some portability problems 2007-10-10 13:38:48 -05:00
Andrew Tridgell
9b53e04377 r10424: for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases
2007-10-10 13:38:44 -05:00
Andrew Tridgell
7dd31288a7 r10421: following on discussions with simo, I have worked out a way of
allowing searches to proceed while another process is in a
transaction, then only upgrading the transaction lock to a write lock
on commit.

The solution is:

 - split tdb_traverse() into two calls, called tdb_traverse() and
   tdb_traverse_read(). The _read() version only gets read locks, and
   will fail any write operations made in the callback from the
   traverse.

 - the normal tdb_traverse() call allows for read or write operations
   in the callback, but gets the transaction lock, preventing
   transastions from starting inside the traverse

In addition we enforce the following rule that you may not start a
transaction within a traverse callback, although you can start a
traverse within a transaction

With these rules in place I believe all the deadlock possibilities are
removed, and we can now allow for searches to happen in parallel with
transactions
2007-10-10 13:38:44 -05:00
Jelmer Vernooij
749b19d34f r10420: Two minor scons fixes 2007-10-10 13:38:43 -05:00
Tim Potter
5f530eacba r10415: The ldb and tdb libraries are bad examples to test out the make proto
code as they are marked as NOPROTO in the config.mk files.
2007-10-10 13:38:43 -05:00
Andrew Tridgell
fa353a5bc5 r10410: blindly update the scons file for tdb. I'm not sure how this works,
but it definately needs transaction.c now
2007-10-10 13:38:42 -05:00
Andrew Tridgell
06bd8abba9 r10405: added transactions into tdb, and hook them into ldb. See my
samba-technical posting for more details on the transactions design.

This also adds a number of command line arguments to tdbtorture,
making it more flexible, and fixes some lock deadlock conditions in
the tdbtorture code.
2007-10-10 13:38:41 -05:00
Andrew Tridgell
40a8ad2d1e r10385: removed obsolete comment 2007-10-10 13:38:36 -05:00
Andrew Tridgell
21e5c328a0 r10384: add _GNU_SOURCE in tdb configure 2007-10-10 13:38:35 -05:00
Tim Potter
54882f88ca r10379: Add files for ldb and tdb to proto_files. The tool for building proto.h
is busted though.
2007-10-10 13:38:34 -05:00
Jelmer Vernooij
59d4450453 r10336: Add sconscript for a couple more subsystems. 2007-10-10 13:38:29 -05:00
Tim Potter
f35c4763d5 r10335: Build tdb tools into bin directory. 2007-10-10 13:38:29 -05:00
Jelmer Vernooij
4bffe44359 r10330: Add SConscript to more subsystems. Some of the tdb tools build now.
Start on custom Samba scons tools (for handling proto generation, pidl, etc)
2007-10-10 13:38:28 -05:00
Tim Potter
360be7028c r10258: Fix an unused/duplicate local variable. 2007-10-10 13:38:12 -05:00
Andrew Tridgell
4673cdd0d2 r10253: a fairly large tdb cleanup and re-organise. Nearly all of this change
just involves splitting up the core tdb.c code into separate files on
logical boundaries, but there are some minor functional changes as well:

 - move the 'struct tdb_context' into tdb_private.h, hiding it from
   users. This was done to allow the structure to change without
   breaking code that uses tdb.

 - added accessor functions tdb_fd(), tdb_name(), and tdb_log_fn() to
   access the elements of struct tdb_context that were used by
   external code but are no longer visible

 - simplied tdb_append() to use tdb_fetch()/tdb_store(), which is just
   as good due to the way tdb locks work

 - changed some of the types (such as tdb_off to tdb_off_t) to make
   syntax highlighting work better

 - removed the old optional spinlock code. It was a bad idea.

 - fixed a bug in tdb_reopen_all() that caused tdbtorture to sometimes
   fail or report nasty looking errors. This is the only real bug
   fixed in this commit. Jeremy/Jerry, you might like to pickup this
   change for Samba3, as that could definately affect smbd in
   Samba3.

The aim of all of these changes is to make the tdb
transactions/journaling code I am working on easier to write. I
started to write it on top of the existing tdb.c code and it got very
messy. Splitting up the code makes it much easier to follow.

There are more cleanups we could do in tdb, such as using uint32_t
instead of u32 (suggested by metze). I'll leave those for another day.
2007-10-10 13:38:12 -05:00