-/*
- make a remote ctdb call - async send. Called in daemon context.
-
- This constructs a ctdb_call request and queues it for processing.
- This call never blocks.
-*/
-struct ctdb_call_state *ctdb_daemon_call_send(struct ctdb_db_context *ctdb_db,
- struct ctdb_call *call)
-{
- int ret;
- struct ctdb_ltdb_header header;
- TDB_DATA data;
- struct ctdb_context *ctdb = ctdb_db->ctdb;
-
- /*
- if we are the dmaster for this key then we don't need to
- send it off at all, we can bypass the network and handle it
- locally. To find out if we are the dmaster we need to look
- in our ltdb
- */
- ret = ctdb_ltdb_fetch(ctdb_db, call->key, &header, ctdb_db, &data);
- if (ret != 0) return NULL;
-
- if (header.dmaster == ctdb->vnn && !(ctdb->flags & CTDB_FLAG_SELF_CONNECT)) {
- struct ctdb_call_state *state;
- state = ctdb_call_local_send(ctdb_db, call, &header, &data);
- talloc_free(data.dptr);
- return state;
- }
-
- talloc_free(data.dptr);
-
- return ctdb_daemon_call_send_remote(ctdb_db, call, &header);
-}
-
-