struct db_context *db;
struct messaging_context *msg;
enum dbwrap_lock_order lock_order;
+ bool busy;
};
struct g_lock {
{
struct g_lock_ctx *result;
- result = talloc(mem_ctx, struct g_lock_ctx);
+ result = talloc_zero(mem_ctx, struct g_lock_ctx);
if (result == NULL) {
return NULL;
}
NTSTATUS status;
bool ok;
+ SMB_ASSERT(!ctx->busy);
+
req = tevent_req_create(mem_ctx, &state, struct g_lock_lock_state);
if (req == NULL) {
return NULL;
struct timeval end;
NTSTATUS status;
+ SMB_ASSERT(!ctx->busy);
+
if ((type == G_LOCK_READ) || (type == G_LOCK_WRITE)) {
/*
* This is an abstraction violation: Normally we do
};
NTSTATUS status;
+ SMB_ASSERT(!ctx->busy);
+
status = dbwrap_do_locked(ctx->db, key, g_lock_unlock_fn, &state);
if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("dbwrap_do_locked failed: %s\n",
};
NTSTATUS status;
+ SMB_ASSERT(!ctx->busy);
+
status = dbwrap_do_locked(
ctx->db, key, g_lock_writev_data_fn, &state);
if (!NT_STATUS_IS_OK(status)) {
NTSTATUS status;
int count;
+ SMB_ASSERT(!ctx->busy);
+
state.fn = fn;
state.private_data = private_data;
};
NTSTATUS status;
+ SMB_ASSERT(!ctx->busy);
+
status = dbwrap_parse_record(ctx->db, key, g_lock_dump_fn, &state);
if (!NT_STATUS_IS_OK(status)) {
DBG_DEBUG("dbwrap_parse_record returned %s\n",
struct tevent_req *req = NULL, *subreq = NULL;
struct g_lock_dump_state *state = NULL;
+ SMB_ASSERT(!ctx->busy);
+
req = tevent_req_create(mem_ctx, &state, struct g_lock_dump_state);
if (req == NULL) {
return NULL;
state->fn = fn;
state->private_data = private_data;
+ SMB_ASSERT(!ctx->busy);
+
subreq = dbwrap_parse_record_send(
state,
ev,
struct g_lock_watch_data_state *state = NULL;
NTSTATUS status;
+ SMB_ASSERT(!ctx->busy);
+
req = tevent_req_create(
mem_ctx, &state, struct g_lock_watch_data_state);
if (req == NULL) {
{
NTSTATUS status;
+ SMB_ASSERT(!ctx->busy);
+
status = dbwrap_do_locked(ctx->db, key, g_lock_wake_watchers_fn, NULL);
if (!NT_STATUS_IS_OK(status)) {
DBG_DEBUG("dbwrap_do_locked returned %s\n",