summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-06-29 10:47:56 +0200
committerMichael Adam <obnox@samba.org>2012-06-29 15:21:19 +0200
commit0a5f36333303812f772a5b7ac84808bd634a4e4a (patch)
tree69d624a35cdc1e6d7bac0e0f366c10743cdae945 /source3/lib/dbwrap
parentd6abf79247c4a60a6cdc221904e6fcacf5e1ac9a (diff)
downloadsamba-0a5f36333303812f772a5b7ac84808bd634a4e4a.tar.gz
samba-0a5f36333303812f772a5b7ac84808bd634a4e4a.tar.bz2
samba-0a5f36333303812f772a5b7ac84808bd634a4e4a.zip
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>
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 922a5cf665..e5662e0357 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1004,7 +1004,7 @@ static int db_ctdb_record_destr(struct db_record* data)
}
/* Do I own this record? */
-static bool db_ctdb_own_record(TDB_DATA ctdb_data, bool read_only)
+static bool db_ctdb_can_use_local_copy(TDB_DATA ctdb_data, bool read_only)
{
struct ctdb_ltdb_header *hdr;
@@ -1098,7 +1098,7 @@ again:
* take the shortcut and just return it.
*/
- if (!db_ctdb_own_record(ctdb_data, false)) {
+ if (!db_ctdb_can_use_local_copy(ctdb_data, false)) {
SAFE_FREE(ctdb_data.dptr);
tdb_chainunlock(ctx->wtdb->tdb, key);
talloc_set_destructor(result, NULL);
@@ -1222,7 +1222,7 @@ static NTSTATUS db_ctdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
* take the shortcut and just return it.
* we bypass the dmaster check for persistent databases
*/
- if (db_ctdb_own_record(ctdb_data, true)) {
+ if (db_ctdb_can_use_local_copy(ctdb_data, true)) {
/* we are the dmaster - avoid the ctdb protocol op */
data->dsize = ctdb_data.dsize - sizeof(struct ctdb_ltdb_header);