From 374cbc7b0ff68e04ee4e395935509c7df817b3c0 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 11 Aug 2014 17:08:20 +1000 Subject: ctdb-locking: Talloc lock request from client specified context This makes sure that when the client context is destroyed, the lock request goes away. If the lock requests is already scheduled, then the lock child process will be terminated. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- ctdb/include/ctdb_private.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ctdb/include/ctdb_private.h') diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 36ebe70ac0..7de9afbf14 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -1582,24 +1582,28 @@ int ctdb_lockall_unmark_prio(struct ctdb_context *ctdb, uint32_t priority); void ctdb_lock_free_request_context(struct lock_request *lock_req); -struct lock_request *ctdb_lock_record(struct ctdb_db_context *ctdb_db, +struct lock_request *ctdb_lock_record(TALLOC_CTX *mem_ctx, + struct ctdb_db_context *ctdb_db, TDB_DATA key, bool auto_mark, void (*callback)(void *, bool), void *private_data); -struct lock_request *ctdb_lock_db(struct ctdb_db_context *ctdb_db, +struct lock_request *ctdb_lock_db(TALLOC_CTX *mem_ctx, + struct ctdb_db_context *ctdb_db, bool auto_mark, void (*callback)(void *, bool), void *private_data); -struct lock_request *ctdb_lock_alldb_prio(struct ctdb_context *ctdb, +struct lock_request *ctdb_lock_alldb_prio(TALLOC_CTX *mem_ctx, + struct ctdb_context *ctdb, uint32_t priority, bool auto_mark, void (*callback)(void *, bool), void *private_data); -struct lock_request *ctdb_lock_alldb(struct ctdb_context *ctdb, +struct lock_request *ctdb_lock_alldb(TALLOC_CTX *mem_ctx, + struct ctdb_context *ctdb, bool auto_mark, void (*callback)(void *, bool), void *private_data); -- cgit