1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

156 Commits

Author SHA1 Message Date
Volker Lendecke
2f38a77a2d dbwrap: Do not rely on dbwrap_record_get_value to return a talloc object
db_tdb_fetch_locked returns the value as part of a larger talloc object
that also contains the key.  This means we can not realloc, but have to
freshly alloc.

Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Nov 29 20:21:51 CET 2012 on sn-devel-104
2012-11-29 20:21:50 +01:00
Volker Lendecke
343ce16e0b s3: Remove db_ctdb_fetch
Note that this also makes the request for read only copies
much more explicity visible in the code.

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:18:49 +01:00
Volker Lendecke
6b8a37f5ca s3: Directly parse local existing records in db_ctdb_parse_record
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:10:13 +01:00
Volker Lendecke
9dd047d67e s3: Factor out db_ctdb_can_use_local_hdr from db_ctdb_can_use_local_copy
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:08:06 +01:00
Volker Lendecke
55d75a3fbe s3: Remove unused code for fetching persistent ctdb records
The only entry point here is parse_record, and this catches the persistent
case with a direct parse now

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:07:26 +01:00
Volker Lendecke
7b43362a9e s3: Avoid db_ctdb_fetch for persistent databases
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:05:25 +01:00
Volker Lendecke
93219f92bb s3: Factor out parse_newest_in_marshall_buffer from pull_newest_from_marshall_buffer
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:03:59 +01:00
Volker Lendecke
850d5de967 s3: reduce db_ctdb_marshall_loop_next to specialized db_ctdb_marshall_buf_parse
now that the db_ctdb_marshall_loop_next_key has been factored out.

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 18:00:02 +01:00
Volker Lendecke
a742b6edd5 s3: Factor out db_ctdb_marshall_loop_next_key from db_ctdb_marshall_loop_next
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:55:19 +01:00
Volker Lendecke
664b170b13 s3: Slightly simplify db_ctdb_marshall_loop_next
Both callers give a key argument

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:52:34 +01:00
Volker Lendecke
af608cdd8c s3: Use db_ctdb_ltdb_parse in db_ctdb_fetch_db_seqnum_from_db
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:52:02 +01:00
Volker Lendecke
7127344863 s3: Use db_ctdb_ltdb_parse in db_ctdb_ltdb_fetch
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:50:36 +01:00
Volker Lendecke
560ed93147 s3: Add db_ctdb_ltdb_parse
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:43:02 +01:00
Volker Lendecke
6e0259d8ec s3: Slightly simplify db_ctdb_transaction_commit
Avoid an unnecessary "else".

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:42:20 +01:00
Volker Lendecke
b206b52748 s3: Remove header==NULL code from db_ctdb_marshall_record
The only call chain (via db_ctdb_marshall_add) has header != NULL

Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-29 17:41:46 +01:00
Volker Lendecke
611675fb37 s3: Fix some blank line endings
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Nov 20 19:18:33 CET 2012 on sn-devel-104
2012-11-20 19:18:33 +01:00
Gregor Beck
bfafb0ce83 s3:dbwrap_ctdb: set errno = ENOSYS if clustering is not supported
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Sep 21 18:05:56 CEST 2012 on sn-devel-104
2012-09-21 18:05:56 +02:00
Volker Lendecke
25bdc36418 s3: Fix a comment
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04 15:15:00 -07:00
Christof Schmitt
424492a963 s3:dbwrap_ctdb: Add DB name and key to warning message
When a operation takes too long, it is useful for debugging to know the
DB and the key.

Signed-off-by: Christian Ambach <ambi@samba.org>
2012-08-31 11:10:14 +02:00
Stefan Metzmacher
ec69eb41bf s3:dbwrap_ctdb: initialize db_record->db
metze
2012-07-31 09:34:20 +02:00
Michael Adam
01863df25d s3_dbrwap_ctdb: improve a comment in db_ctdb_can_use_local_record()
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:21 +02:00
Michael Adam
b46977e4f6 s3:dbwrap_ctdb: fix a comment in db_ctdb_fetch()
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:20 +02:00
Michael Adam
92808a6005 s3:dbwrap_ctdb: expand the comment for the db_ctdb_can_use_local_copy() function
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:19 +02:00
Michael Adam
0a5f363333 s3:dbwrap_ctdb: rename db_ctdb_own_record() -> db_ctdb_can_use_local_copy()
This matches the function's intention much closer, since it
also tests whether we have a valid local read only copy.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:19 +02:00
Michael Adam
d6abf79247 s3:dbrwap_ctdb: remove commented out legacy code 2012-06-29 15:21:18 +02:00
Michael Adam
9d11277337 s3:dbwrap_ctdb: fix fetch/fetch_locked when samba is built against old ctdb
The introduction of read only copies has broken the algorithm for
deteting whether we can use the local record copy for fetch_locked
and fetch: For fetch locked the new code always uses the local copy
if there is one...

This patch re-establish the original algorithm for the build against
a ctdb without read only record copies.

Reported-by: Gregor Beck <gbeck@sernet.de>
2012-06-29 15:21:17 +02:00
Andrew Bartlett
666dba3353 s3-param: Rename loadparm_s3_context -> loadparm_s3_helpers
This helps clarify the role of this structure and wrapper function.

The purpose here is to provide helper functions to the lib/param
loadparm_context that point back at the s3 lp_ functions.  This allows
a struct loadparm_context to be passed to any point in the code, and
always refer to the correct loadparm system.  If this has not been
set, the variables loaded in the lib/param code will be returned.

As requested by Michael Adam.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun 27 17:11:16 CEST 2012 on sn-devel-104
2012-06-27 17:11:16 +02:00
Gregor Beck
c71062fcf4 s3:lib:dbwrap: fix return value of db_ctdb_traverse[_read] for non-persistent dbs
to return the number of traversed records upon successful traverse.

Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-27 08:18:17 +02:00
Rusty Russell
9d97bf3f47 dbwrap: dbwrap_local_open()
This simply opens a tdb: it will eventually switch depending on the
extension.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
1acf548eb7 dbwrap: remove get_flags().
The flags returned were TDB-specific: this was only used for detecting
the endianness of obsolete databases (the conversion code was put in in
2003, with reference to Samba 2.3).

It's easier to remove it than to translate the NTDB flags to TDB flags,
and it's a really weird thing to ask for anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Michael Adam
73b200064f s3:util: rename procid_equal() to serverid_equal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-21 08:27:32 +02:00
Michael Adam
e945511aae move the dbwrap library to the top level
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon May 14 04:04:55 CEST 2012 on sn-devel-104
2012-05-14 04:04:55 +02:00
Michael Adam
e96a842527 s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_tdb.c 2012-05-13 22:41:49 +02:00
Michael Adam
db7a8bf43c s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_rbt.c 2012-05-13 22:41:49 +02:00
Michael Adam
746548401f s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_ctdb.c 2012-05-13 22:41:49 +02:00
Michael Adam
03183e3584 s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_file.c 2012-05-13 22:41:48 +02:00
Michael Adam
05afaa8361 s3:lib:dbwrap: use [u]int[num]_t consistently in dbwrap_util.c 2012-05-13 22:41:48 +02:00
Michael Adam
508a33fc2a s3:dbwrap: move definition of dbwrap_lock_order to dbwrap.h
This is needed in all of the library, not only in the dbwrap_open part.
2012-05-13 22:41:48 +02:00
Volker Lendecke
374ca0bd26 s3: Fix Coverity ID 2751: REVERSE_INULL 2012-04-24 13:28:50 +02:00
Andrew Bartlett
3969cc28e8 s3-dbwrap: A void function can not return a value
Only non-gcc compilers seem to notice this as an error.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Apr 23 05:58:52 CEST 2012 on sn-devel-104
2012-04-23 05:58:52 +02:00
Volker Lendecke
13d667bbff s3: Implement db_id for dbwrap_cache
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Apr 21 13:46:00 CEST 2012 on sn-devel-104
2012-04-21 13:46:00 +02:00
Volker Lendecke
d26028316d s3: Initialize "stored_callback" in dbwrap_cache
This should fix one of the recent flaky tests
2012-04-21 12:10:49 +02:00
Stefan Metzmacher
3f00295f5e s3-dbwrap: dbwrap_watch_record_stored => NT_STATUS_NOT_FOUND is ok...
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Apr 20 17:05:52 CEST 2012 on sn-devel-104
2012-04-20 17:05:52 +02:00
Volker Lendecke
99fa29ae09 s3-dbwrap: Add dbwrap_record_watch_send/recv
With this API you can asynchronously wait for a record to be modified
2012-04-19 22:24:18 +02:00
Volker Lendecke
61c97506e8 s3-dbwrap: Add dbwrap_set_stored_callback
This is a per-db function that is called whenever some record is modified
2012-04-20 13:42:40 +02:00
Volker Lendecke
8e5b11bc14 s3-dbwrap: Add "db_context" to "db_record" 2012-04-20 13:42:40 +02:00
Volker Lendecke
0f20ffbcbd s3-dbwrap: Add dbwrap_db_id
This returns a blob uniquely identifying the database
2012-04-20 13:42:40 +02:00
Volker Lendecke
f1c90e12f5 s3: Fix Coverity ID 2744: CHECKED_RETURN 2012-04-19 17:37:38 +02:00
Volker Lendecke
85c1e895a5 s3: Fix Coverity ID 2745 and 2746: FORWARD_NULL
We can assume that the rbt dbs are around
2012-04-19 17:37:37 +02:00
Andrew Bartlett
00d493b00c s3-dbwrap: Remove dead code: talloc_stackframe() cannot fail 2012-04-19 12:34:33 +02:00