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

166 Commits

Author SHA1 Message Date
Christian Ambach
9910b8050c s3:lib/dbwrap add missing curly braces
violation of README.Coding

Signed-off-by: Christian Ambach <ambi@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-16 23:22:19 +02:00
Volker Lendecke
e13021e3af dbwrap: Allow dbwrap_record_watch_recv to not lock the record
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:23 -07:00
Volker Lendecke
c2b26a43ff dbwrap-ctdb: Avoid a talloc_stackframe()
We have only a single allocation in this routine, so I think we can live
without a stackframe.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 11:19:59 +01:00
Volker Lendecke
1409895d9e dbwrap-ctdb: Use ctdbd_parse in db_ctdb_parse_record
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-26 11:19:19 +01:00
Volker Lendecke
bbb4068c93 dbwrap: Use tdb_null in db_ctdb_delete
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Mar 25 19:42:30 CET 2013 on sn-devel-104
2013-03-25 19:42:30 +01:00
Michael Adam
ff65500f2b s3:dbrwap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_persistent_callback_read()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04 17:14:22 +01:00
Michael Adam
3949854549 s3:dbwrap_ctdb: ZERO_STRUCT(rec) just to be sure in traverse_read_callback()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
a09f3a3551 s3:dbwrap_ctdb: add "db_context" to "db_record"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Stefan Metzmacher
25bdab9c61 s3:dbwrap_ctdb: setup result->name in db_open_ctdb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Volker Lendecke
aea49ed37a dbwrap: Use INCOMPATIBLE_HASH for dbwrap_watchers.tdb
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-11 17:10:48 +01:00
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