From a6b13b21c1e52ad49b2629d2610bef59858b9fd9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 21 Dec 2010 15:29:23 +0100 Subject: [PATCH] client: add accessor function ctdb_header_from_record_handle(). (This used to be ctdb commit cf57efd440ccc3db381386f4749bfcbf8ac5ecae) --- ctdb/client/ctdb_client.c | 9 +++++++++ ctdb/include/ctdb_private.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 99ff72d2b1c..a43710f9aa5 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -4234,3 +4234,12 @@ int ctdb_ctrl_getstathistory(struct ctdb_context *ctdb, struct timeval timeout, return 0; } + +struct ctdb_ltdb_header *ctdb_header_from_record_handle(struct ctdb_record_handle *h) +{ + if (h == NULL) { + return NULL; + } + + return &h->header; +} diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 6ba0c180801..e3f77e905ea 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -1403,4 +1403,6 @@ int32_t ctdb_local_schedule_for_deletion(struct ctdb_db_context *ctdb_db, const struct ctdb_ltdb_header *hdr, TDB_DATA key); +struct ctdb_ltdb_header *ctdb_header_from_record_handle(struct ctdb_record_handle *h); + #endif