Merge branch 'master' of git://git.samba.org/sahlberg/ctdb
[metze/ctdb/wip.git] / include / ctdb.h
1 /*
2    ctdb database library
3
4    Copyright (C) Ronnie sahlberg 2010
5    Copyright (C) Rusty Russell 2010
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _CTDB_H
22 #define _CTDB_H
23 #include <sys/types.h>
24 #include <stdint.h>
25 #include <stdbool.h>
26 #include <stdarg.h>
27 #include <stdio.h>
28 #include <tdb.h>
29 #include <ctdb_protocol.h>
30
31 /**
32  * ctdb - a library for accessing tdbs controlled by ctdbd
33  *
34  * ctdbd (clustered tdb daemon) is a daemon designed to syncronize TDB
35  * databases across a cluster.  Using this library, you can communicate with
36  * the daemon to access the databases, pass messages across the cluster, and
37  * control the daemon itself.
38  *
39  * The general API is event-driven and asynchronous: you call the
40  * *_send functions, supplying callbacks, then when the ctdbd file
41  * descriptor is usable, call ctdb_service() to perform read from it
42  * and call your callbacks, which use the *_recv functions to unpack
43  * the replies from ctdbd.
44  *
45  * There is also a synchronous wrapper for each function for trivial
46  * programs; these can be found in the section marked "Synchronous API".
47  */
48
49 /**
50  * ctdb_log_fn_t - logging function for ctdbd
51  * @log_priv: private (typesafe) arg via ctdb_connect
52  * @severity: syslog-style severity
53  * @format: printf-style format string.
54  * @ap: arguments for formatting.
55  *
56  * The severity passed to log() are as per syslog(3).  In particular,
57  * LOG_DEBUG is used for tracing, LOG_WARNING is used for unusual
58  * conditions which don't necessarily return an error through the API,
59  * LOG_ERR is used for errors such as lost communication with ctdbd or
60  * out-of-memory, LOG_ALERT is used for library usage bugs, LOG_CRIT is
61  * used for libctdb internal consistency checks.
62  *
63  * The log() function can be typesafe: the @log_priv arg to
64  * ctdb_donnect and signature of log() should match.
65  */
66 typedef void (*ctdb_log_fn_t)(void *log_priv,
67                               int severity, const char *format, va_list ap);
68
69 /**
70  * ctdb_connect - connect to ctdb using the specified domain socket.
71  * @addr: the socket address, or NULL for default
72  * @log: the logging function
73  * @log_priv: the private argument to the logging function.
74  *
75  * Returns a ctdb context if successful or NULL.  Use ctdb_disconnect() to
76  * release the returned ctdb_connection when finished.
77  *
78  * See Also:
79  *      ctdb_log_fn_t, ctdb_log_file()
80  */
81 struct ctdb_connection *ctdb_connect(const char *addr,
82                                      ctdb_log_fn_t log_fn, void *log_priv);
83
84 /**
85  * ctdb_log_file - example logging function
86  *
87  * Logs everything at priority LOG_WARNING or above to the file given (via
88  * the log_priv argument, usually stderr).
89  */
90 void ctdb_log_file(FILE *, int, const char *, va_list);
91
92 /**
93  * ctdb_log_level - level at which to call logging function
94  *
95  * This variable globally controls filtering on the logging function.
96  * It is initialized to LOG_WARNING, meaning that strange but nonfatal
97  * events, as well as errors and API misuses are reported.
98  *
99  * Set it to LOG_DEBUG to receive all messages.
100  */
101 extern int ctdb_log_level;
102
103 /**
104  * ctdb_disconnect - close down a connection to ctdbd.
105  * @ctdb: the ctdb connectio returned from ctdb_connect.
106  *
107  * The @ctdb arg will be freed by this call, and must not be used again.
108  */
109 void ctdb_disconnect(struct ctdb_connection *ctdb);
110
111 /***
112  *
113  *  Asynchronous API
114  *
115  ***/
116
117 /**
118  * ctdb_get_fd - get the filedescriptor to select/poll on
119  * @ctdb: the ctdb_connection from ctdb_connect.
120  *
121  * By using poll or select on this file descriptor, you will know when to call
122  * ctdb_service().
123  *
124  * See Also:
125  *      ctdb_which_events(), ctdb_service()
126  */
127 int ctdb_get_fd(struct ctdb_connection *ctdb);
128
129 /**
130  * ctdb_which_events - determine which events ctdb_service wants to see
131  * @ctdb: the ctdb_connection from ctdb_connect.
132  *
133  * This returns POLLIN, possibly or'd with POLLOUT if there are writes
134  * pending.  You can set this straight into poll.events.
135  *
136  * See Also:
137  *      ctdb_service()
138  */
139 int ctdb_which_events(struct ctdb_connection *ctdb);
140
141 /**
142  * ctdb_service - service any I/O and callbacks from ctdbd communication
143  * @ctdb: the ctdb_connection from ctdb_connect.
144  * @revents: which events are available.
145  *
146  * This is the core of the library: it read and writes to the ctdbd
147  * socket.  It may call callbacks registered with the various _send
148  * functions.
149  *
150  * revents is a bitset: POLLIN and/or POLLOUT may be set to indicate
151  * it is worth attempting to read/write the (nonblocking)
152  * filedescriptor respectively.
153  *
154  * Note that the synchronous functions call this internally.
155  * Returns false on catastrophic failure.
156  */
157 bool ctdb_service(struct ctdb_connection *ctdb, int revents);
158
159 /**
160  * struct ctdb_request - handle for an outstanding request
161  *
162  * This opaque structure returned from various *_send functions gives
163  * you a handle by which you can cancel a request.  You can't do
164  * anything else with it until the request is completed and it is
165  * handed to your callback function.
166  */
167 struct ctdb_request;
168
169 /**
170  * ctdb_request_free - free a completed request
171  *
172  * This frees a request: you should only call it once it has been
173  * handed to your callback.  For incomplete requests, see ctdb_cancel().
174  */
175 void ctdb_request_free(struct ctdb_connection *ctdb, struct ctdb_request *req);
176
177 /**
178  * ctdb_callback_t - callback for completed requests.
179  *
180  * This would normally unpack the request using ctdb_*_recv().  You
181  * must free the request using ctdb_request_free().
182  *
183  * Note that due to macro magic, actual your callback can be typesafe:
184  * instead of taking a void *, it can take a type which matches the
185  * actual private parameter.
186  */
187 typedef void (*ctdb_callback_t)(struct ctdb_connection *ctdb,
188                                 struct ctdb_request *req, void *private_data);
189
190 /**
191  * struct ctdb_db - connection to a particular open TDB
192  *
193  * This represents a particular open database: you receive it from
194  * ctdb_attachdb or ctdb_attachdb_recv to manipulate a database.
195  *
196  * You have to free the handle with ctdb_detachdb() when finished with it.
197  */
198 struct ctdb_db;
199
200 /**
201  * ctdb_attachdb_send - open a clustered TDB
202  * @ctdb: the ctdb_connection from ctdb_connect.
203  * @name: the filename of the database (no /).
204  * @persistent: whether the database is persistent across ctdbd's life
205  * @tdb_flags: the flags to pass to tdb_open.
206  * @callback: the callback when we're attached or failed (typesafe)
207  * @cbdata: the argument to callback()
208  *
209  * This function connects to a TDB controlled by ctdbd.  It can create
210  * a new TDB if it does not exist, depending on tdb_flags.  Returns
211  * the pending request, or NULL on error.
212  */
213 struct ctdb_request *
214 ctdb_attachdb_send(struct ctdb_connection *ctdb,
215                    const char *name, bool persistent, uint32_t tdb_flags,
216                    ctdb_callback_t callback, void *cbdata);
217
218 /**
219  * ctdb_attachdb_recv - read an ctdb_attach reply from ctdbd
220  * @ctdb: the ctdb_connection from ctdb_connect.
221  * @req: the completed request.
222  *
223  * This returns NULL if something went wrong, or otherwise the open database.
224  */
225 struct ctdb_db *ctdb_attachdb_recv(struct ctdb_connection *ctdb,
226                                    struct ctdb_request *req);
227
228
229 /**
230  * struct ctdb_lock - a record lock on a clustered TDB database
231  *
232  * This locks a subset of the database across the entire cluster; it
233  * is the fundamental sychronization element for ctdb.  You cannot have
234  * more than one lock at once.
235  *
236  * You MUST NOT block during holding this lock and MUST release it
237  * quickly by performing ctdb_release_lock(lock).
238  * Do NOT make any system calls that may block while holding the lock.
239  *
240  * Try to release the lock as quickly as possible.
241  */
242 struct ctdb_lock;
243
244 /**
245  * ctdb_rrl_callback_t - callback for ctdb_readrecordlock_async
246  *
247  * This is not the standard ctdb_callback_t, because there is often no
248  * request required to access a database record (ie. if it is local already).
249  * So the callback is handed the lock directly: it might be NULL if there
250  * was an error obtaining the lock.
251  *
252  * See Also:
253  *      ctdb_readrecordlock_async(), ctdb_readrecordlock()
254  */
255 typedef void (*ctdb_rrl_callback_t)(struct ctdb_db *ctdb_db,
256                                     struct ctdb_lock *lock,
257                                     TDB_DATA data,
258                                     void *private_data);
259
260 /**
261  * ctdb_readrecordlock_async - read and lock a record
262  * @ctdb_db: the database handle from ctdb_attachdb/ctdb_attachdb_recv.
263  * @key: the key of the record to lock.
264  * @callback: the callback once the record is locked (typesafe).
265  * @cbdata: the argument to callback()
266  *
267  * This returns true on success.  Commonly, we can obtain the record
268  * immediately and so the callback will be invoked.  Otherwise a request
269  * will be queued to ctdbd for the record.
270  *
271  * If failure is immediate, false is returned.  Otherwise, the callback
272  * may receive a NULL lock arg to indicate asynchronous failure.
273  */
274 bool ctdb_readrecordlock_async(struct ctdb_db *ctdb_db, TDB_DATA key,
275                                ctdb_rrl_callback_t callback, void *cbdata);
276
277 /**
278  * ctdb_writerecord - write a locked record in a TDB
279  * @ctdb_db: the database handle from ctdb_attachdb/ctdb_attachdb_recv.
280  * @lock: the lock from ctdb_readrecordlock/ctdb_readrecordlock_recv
281  * @data: the new data to place in the record.
282  */
283 bool ctdb_writerecord(struct ctdb_db *ctdb_db,
284                       struct ctdb_lock *lock, TDB_DATA data);
285
286 /**
287  * ctdb_release_lock - release a record lock on a TDB
288  * @ctdb_db: the database handle from ctdb_attachdb/ctdb_attachdb_recv.
289  * @lock: the lock from ctdb_readrecordlock/ctdb_readrecordlock_async
290  */
291 void ctdb_release_lock(struct ctdb_db *ctdb_db, struct ctdb_lock *lock);
292
293 /**
294  * ctdb_message_fn_t - messaging callback for ctdb messages
295  *
296  * ctdbd provides a simple messaging API; you can register for a particular
297  * 64-bit id on which you want to send messages, and send to other ids.
298  *
299  * See Also:
300  *      ctdb_set_message_handler_send()
301  */
302 typedef void (*ctdb_message_fn_t)(struct ctdb_connection *,
303                                   uint64_t srvid, TDB_DATA data, void *);
304
305 /**
306  * ctdb_set_message_handler_send - register for messages to a srvid
307  * @ctdb: the ctdb_connection from ctdb_connect.
308  * @srvid: the 64 bit identifier for our messages.
309  * @handler: the callback when we receive such a message (typesafe)
310  * @handler_data: the argument to handler()
311  * @callback: the callback when ctdb replies to our message (typesafe)
312  * @cbdata: the argument to callback()
313  *
314  * Note: our callback will always be called before handler.
315  *
316  * See Also:
317  *      ctdb_set_message_handler_recv(), ctdb_remove_message_handler_send()
318  */
319 struct ctdb_request *
320 ctdb_set_message_handler_send(struct ctdb_connection *ctdb, uint64_t srvid,
321                               ctdb_message_fn_t handler,
322                               void *handler_data,
323                               ctdb_callback_t callback,
324                               void *cbdata);
325
326 /**
327  * ctdb_set_message_handler_recv - read a set_message_handler result
328  * @ctdb: the ctdb_connection from ctdb_connect.
329  * @req: the completed request
330  *
331  * If this returns true, the registered handler may be called from the next
332  * ctdb_service().  If this returns false, the registration failed.
333  */
334 bool ctdb_set_message_handler_recv(struct ctdb_connection *ctdb,
335                                    struct ctdb_request *handle);
336
337 /**
338  * ctdb_remove_message_handler_send - unregister for messages to a srvid
339  * @ctdb: the ctdb_connection from ctdb_connect.
340  * @srvid: the 64 bit identifier for our messages.
341  * @handler: the callback when we receive such a message (typesafe)
342  * @handler_data: the argument to handler()
343  * @callback: the callback when ctdb replies to our message (typesafe)
344  * @cbdata: the argument to callback()
345  *
346  * This undoes a successful ctdb_set_message_handler or
347  * ctdb_set_message_handler_recv.
348  */
349 struct ctdb_request *
350 ctdb_remove_message_handler_send(struct ctdb_connection *ctdb, uint64_t srvid,
351                                  ctdb_message_fn_t handler, void *handler_data,
352                                  ctdb_callback_t callback, void *cbdata);
353
354 /**
355  * ctdb_remove_message_handler_recv - read a remove_message_handler result
356  * @ctdb: the ctdb_connection from ctdb_connect.
357  * @req: the completed request
358  *
359  * After this returns true, the registered handler will no longer be called.
360  * If this returns false, the de-registration failed.
361  */
362 bool ctdb_remove_message_handler_recv(struct ctdb_connection *ctdb,
363                                       struct ctdb_request *req);
364
365
366 /**
367  * ctdb_send_message - send a message via ctdbd
368  * @ctdb: the ctdb_connection from ctdb_connect.
369  * @pnn: the physical node number to send to
370  * @srvid: the 64 bit identifier for this message type.
371  * @data: the data to send
372  *
373  * This allows arbitrary messages to be sent across the cluster to those
374  * listening (via ctdb_set_message_handler et al).
375  *
376  * This queues a message to be sent: you will need to call
377  * ctdb_service() to actually send the message.  There is no callback
378  * because there is no acknowledgement.
379  *
380  * See Also:
381  *      ctdb_getpnn_send(), ctdb_getpnn()
382  */
383 bool ctdb_send_message(struct ctdb_connection *ctdb, uint32_t pnn, uint64_t srvid, TDB_DATA data);
384
385 /**
386  * ctdb_getpnn_send - read the pnn number of a node.
387  * @ctdb: the ctdb_connection from ctdb_connect.
388  * @destnode: the destination node (see below)
389  * @callback: the callback when ctdb replies to our message (typesafe)
390  * @cbdata: the argument to callback()
391  *
392  * There are several special values for destnode, detailed in
393  * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the
394  * local ctdbd.
395  */
396 struct ctdb_request *
397 ctdb_getpnn_send(struct ctdb_connection *ctdb,
398                  uint32_t destnode,
399                  ctdb_callback_t callback,
400                  void *cbdata);
401 /**
402  * ctdb_getpnn_recv - read an ctdb_getpnn reply from ctdbd
403  * @ctdb: the ctdb_connection from ctdb_connect.
404  * @req: the completed request.
405  * @pnn: a pointer to the pnn to fill in
406  *
407  * This returns false if something went wrong, or otherwise fills in pnn.
408  */
409 bool ctdb_getpnn_recv(struct ctdb_connection *ctdb,
410                       struct ctdb_request *req, uint32_t *pnn);
411
412
413 /**
414  * ctdb_getrecmaster_send - read the recovery master of a node
415  * @ctdb: the ctdb_connection from ctdb_connect.
416  * @destnode: the destination node (see below)
417  * @callback: the callback when ctdb replies to our message (typesafe)
418  * @cbdata: the argument to callback()
419  *
420  * There are several special values for destnode, detailed in
421  * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the
422  * local ctdbd.
423  */
424 struct ctdb_request *
425 ctdb_getrecmaster_send(struct ctdb_connection *ctdb,
426                         uint32_t destnode,
427                             ctdb_callback_t callback, void *cbdata);
428
429 /**
430  * ctdb_getrecmaster_recv - read an ctdb_getrecmaster reply from ctdbd
431  * @ctdb: the ctdb_connection from ctdb_connect.
432  * @req: the completed request.
433  * @recmaster: a pointer to the recmaster to fill in
434  *
435  * This returns false if something went wrong, or otherwise fills in
436  * recmaster.
437  */
438 bool ctdb_getrecmaster_recv(struct ctdb_connection *ctdb,
439                             struct ctdb_request *handle,
440                             uint32_t *recmaster);
441
442 /**
443  * ctdb_cancel - cancel an uncompleted request
444  * @ctdb: the ctdb_connection from ctdb_connect.
445  * @req: the uncompleted request.
446  *
447  * This cancels a request, returning true.  You may not cancel a
448  * request which has already been completed (ie. once its callback has
449  * been called); you should simply use ctdb_request_free() in that case.
450  */
451 void ctdb_cancel(struct ctdb_connection *ctdb, struct ctdb_request *req);
452
453 /***
454  *
455  *  Synchronous API
456  *
457  ***/
458
459 /**
460  * ctdb_attachdb - open a clustered TDB (synchronous)
461  * @ctdb: the ctdb_connection from ctdb_connect.
462  * @name: the filename of the database (no /).
463  * @persistent: whether the database is persistent across ctdbd's life
464  * @tdb_flags: the flags to pass to tdb_open.
465  *
466  * Do a ctdb_attachdb_send and wait for it to complete.
467  * Returns NULL on failure.
468  */
469 struct ctdb_db *ctdb_attachdb(struct ctdb_connection *ctdb,
470                               const char *name, bool persistent,
471                               uint32_t tdb_flags);
472
473 /**
474  * ctdb_detachdb - close a clustered TDB.
475  * @ctdb: the ctdb_connection from ctdb_connect.
476  * @db: the database from ctdb_attachdb/ctdb_attachdb_send
477  *
478  * Closes a clustered tdb.
479  */
480 void ctdb_detachdb(struct ctdb_connection *ctdb, struct ctdb_db *db);
481
482 /**
483  * ctdb_readrecordlock - read and lock a record (synchronous)
484  * @ctdb: the ctdb_connection from ctdb_connect.
485  * @ctdb_db: the database handle from ctdb_attachdb/ctdb_attachdb_recv.
486  * @key: the key of the record to lock.
487  * @req: a pointer to the request, if one is needed.
488  *
489  * Do a ctdb_readrecordlock_send and wait for it to complete.
490  * Returns NULL on failure.
491  */
492 struct ctdb_lock *ctdb_readrecordlock(struct ctdb_connection *ctdb,
493                                       struct ctdb_db *ctdb_db, TDB_DATA key,
494                                       TDB_DATA *data);
495
496
497 /**
498  * ctdb_set_message_handler - register for messages to a srvid (synchronous)
499  * @ctdb: the ctdb_connection from ctdb_connect.
500  * @srvid: the 64 bit identifier for our messages.
501  * @handler: the callback when we receive such a message (typesafe)
502  * @cbdata: the argument to handler()
503  *
504  * If this returns true, the message handler can be called from any
505  * ctdb_service() (which is also called indirectly by other
506  * synchronous functions).  If this returns false, the registration
507  * failed.
508  */
509 bool ctdb_set_message_handler(struct ctdb_connection *ctdb, uint64_t srvid,
510                               ctdb_message_fn_t handler, void *cbdata);
511
512
513 /**
514  * ctdb_remove_message_handler - deregister for messages (synchronous)
515  * @ctdb: the ctdb_connection from ctdb_connect.
516  * @srvid: the 64 bit identifier for our messages.
517  * @handler: the callback when we receive such a message (typesafe)
518  * @handler_data: the argument to handler()
519  *
520  * If this returns true, the message handler will no longer be called.
521  * If this returns false, the deregistration failed.
522  */
523 bool ctdb_remove_message_handler(struct ctdb_connection *ctdb, uint64_t srvid,
524                                  ctdb_message_fn_t handler, void *handler_data);
525
526 /**
527  * ctdb_getpnn - read the pnn number of a node (synchronous)
528  * @ctdb: the ctdb_connection from ctdb_connect.
529  * @destnode: the destination node (see below)
530  * @pnn: a pointer to the pnn to fill in
531  *
532  * There are several special values for destnode, detailed in
533  * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the
534  * local ctdbd.
535  *
536  * Returns true and fills in *pnn on success.
537  */
538 bool ctdb_getpnn(struct ctdb_connection *ctdb,
539                  uint32_t destnode,
540                  uint32_t *pnn);
541
542 /**
543  * ctdb_getrecmaster - read the recovery master of a node (synchronous)
544  * @ctdb: the ctdb_connection from ctdb_connect.
545  * @destnode: the destination node (see below)
546  * @recmaster: a pointer to the recmaster to fill in
547  *
548  * There are several special values for destnode, detailed in
549  * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the
550  * local ctdbd.
551  *
552  * Returns true and fills in *recmaster on success.
553  */
554 bool ctdb_getrecmaster(struct ctdb_connection *ctdb,
555                        uint32_t destnode,
556                        uint32_t *recmaster);
557
558 /* These ugly macro wrappers make the callbacks typesafe. */
559 #include <ctdb_typesafe_cb.h>
560 #define ctdb_sendcb(cb, cbdata)                                         \
561          typesafe_cb_preargs(void, (cb), (cbdata),                      \
562                              struct ctdb_connection *, struct ctdb_request *)
563
564 #define ctdb_msgcb(cb, cbdata)                                          \
565         typesafe_cb_preargs(void, (cb), (cbdata),                       \
566                             struct ctdb_connection *, uint64_t, TDB_DATA)
567
568 #define ctdb_connect(addr, log, logpriv)                                \
569         ctdb_connect((addr),                                            \
570                      typesafe_cb_postargs(void, (log), (logpriv),       \
571                                           int, const char *, va_list),  \
572                      (logpriv))
573
574 #define ctdb_set_message_handler(ctdb, srvid, handler, hdata)           \
575         ctdb_set_message_handler((ctdb), (srvid),                       \
576                                  ctdb_msgcb((handler), (hdata)), (hdata))
577
578 #define ctdb_remove_message_handler(ctdb, srvid, handler, hdata)        \
579         ctdb_remove_message_handler((ctdb), (srvid),                    \
580                                     ctdb_msgcb((handler), (hdata)), (hdata))
581
582 #define ctdb_attachdb_send(ctdb, name, persistent, tdb_flags, cb, cbdata) \
583         ctdb_attachdb_send((ctdb), (name), (persistent), (tdb_flags),   \
584                            ctdb_sendcb((cb), (cbdata)), (cbdata))
585
586 #define ctdb_readrecordlock_async(_ctdb_db, key, cb, cbdata)            \
587         ctdb_readrecordlock_async((_ctdb_db), (key),                    \
588                 typesafe_cb_preargs(void, (cb), (cbdata),               \
589                                     struct ctdb_db *, struct ctdb_lock *, \
590                                     TDB_DATA), (cbdata))
591
592 #define ctdb_set_message_handler_send(ctdb, srvid, handler, hdata, cb, cbdata) \
593         ctdb_set_message_handler_send((ctdb), (srvid),                  \
594                                       ctdb_msgcb((handler), (hdata)), (hdata), \
595                                       ctdb_sendcb((cb), (cbdata)), (cbdata))
596
597 #define ctdb_remove_message_handler_send(ctdb, srvid, handler, hdata, cb, cbdata) \
598         ctdb_remove_message_handler_send((ctdb), (srvid),               \
599               ctdb_msgcb((handler), (hdata)), (hdata),                  \
600               ctdb_sendcb((cb), (cbdata)), (cbdata))
601
602 #define ctdb_getpnn_send(ctdb, destnode, cb, cbdata)                    \
603         ctdb_getpnn_send((ctdb), (destnode),                            \
604                          ctdb_sendcb((cb), (cbdata)), (cbdata))
605
606 #define ctdb_getrecmaster_send(ctdb, destnode, cb, cbdata)              \
607         ctdb_getrecmaster_send((ctdb), (destnode),                      \
608                                ctdb_sendcb((cb), (cbdata)), (cbdata))
609 #endif