mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
dbwrap: Remove "db_context->try_fetch_locked()" fn pointer
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
8089f5190c
commit
a41af25ebd
@ -40,9 +40,6 @@ struct db_context {
|
||||
struct db_record *(*fetch_locked)(struct db_context *db,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
TDB_DATA key);
|
||||
struct db_record *(*try_fetch_locked)(struct db_context *db,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
TDB_DATA key);
|
||||
int (*traverse)(struct db_context *db,
|
||||
int (*f)(struct db_record *rec,
|
||||
void *private_data),
|
||||
|
@ -169,20 +169,6 @@ static struct db_record *db_tdb_fetch_locked(
|
||||
return db_tdb_fetch_locked_internal(db, ctx, mem_ctx, key);
|
||||
}
|
||||
|
||||
static struct db_record *db_tdb_try_fetch_locked(
|
||||
struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key)
|
||||
{
|
||||
struct db_tdb_ctx *ctx = talloc_get_type_abort(db->private_data,
|
||||
struct db_tdb_ctx);
|
||||
|
||||
db_tdb_log_key("Trying to lock", key);
|
||||
if (tdb_chainlock_nonblock(ctx->wtdb->tdb, key) != 0) {
|
||||
DEBUG(3, ("tdb_chainlock_nonblock failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
return db_tdb_fetch_locked_internal(db, ctx, mem_ctx, key);
|
||||
}
|
||||
|
||||
static NTSTATUS db_tdb_do_locked(struct db_context *db, TDB_DATA key,
|
||||
void (*fn)(struct db_record *rec,
|
||||
TDB_DATA value,
|
||||
@ -509,7 +495,6 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
|
||||
db_tdb->id.ino = st.st_ino;
|
||||
|
||||
result->fetch_locked = db_tdb_fetch_locked;
|
||||
result->try_fetch_locked = db_tdb_try_fetch_locked;
|
||||
result->do_locked = db_tdb_do_locked;
|
||||
result->traverse = db_tdb_traverse;
|
||||
result->traverse_read = db_tdb_traverse_read;
|
||||
|
@ -1264,24 +1264,6 @@ static struct db_record *db_ctdb_fetch_locked(struct db_context *db,
|
||||
return fetch_locked_internal(ctx, mem_ctx, key, false);
|
||||
}
|
||||
|
||||
static struct db_record *db_ctdb_try_fetch_locked(struct db_context *db,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
TDB_DATA key)
|
||||
{
|
||||
struct db_ctdb_ctx *ctx = talloc_get_type_abort(db->private_data,
|
||||
struct db_ctdb_ctx);
|
||||
|
||||
if (ctx->transaction != NULL) {
|
||||
return db_ctdb_fetch_locked_transaction(ctx, mem_ctx, key);
|
||||
}
|
||||
|
||||
if (db->persistent) {
|
||||
return db_ctdb_fetch_locked_persistent(ctx, mem_ctx, key);
|
||||
}
|
||||
|
||||
return fetch_locked_internal(ctx, mem_ctx, key, true);
|
||||
}
|
||||
|
||||
struct db_ctdb_parse_record_state {
|
||||
void (*parser)(TDB_DATA key, TDB_DATA data, void *private_data);
|
||||
void *private_data;
|
||||
@ -1988,7 +1970,6 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
|
||||
|
||||
result->private_data = (void *)db_ctdb;
|
||||
result->fetch_locked = db_ctdb_fetch_locked;
|
||||
result->try_fetch_locked = db_ctdb_try_fetch_locked;
|
||||
result->parse_record = db_ctdb_parse_record;
|
||||
result->parse_record_send = db_ctdb_parse_record_send;
|
||||
result->parse_record_recv = db_ctdb_parse_record_recv;
|
||||
|
Loading…
Reference in New Issue
Block a user