Skip to content

Commit

Permalink
dbwrap: Remove "db_context->try_fetch_locked()" fn pointer
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
vlendec authored and jrasamba committed Jun 4, 2021
1 parent 8089f51 commit a41af25
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
3 changes: 0 additions & 3 deletions lib/dbwrap/dbwrap_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
15 changes: 0 additions & 15 deletions lib/dbwrap/dbwrap_tdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 0 additions & 19 deletions source3/lib/dbwrap/dbwrap_ctdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a41af25

Please sign in to comment.