int ctdbd_db_attach(struct ctdbd_connection *conn, const char *name,
uint32_t *db_id, int tdb_flags);
-NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id,
- TDB_DATA key);
+int ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key);
NTSTATUS ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id,
TDB_DATA key, bool local_copy,
/*
* force the migration of a record to this node
*/
-NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id,
- TDB_DATA key)
+int ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key)
{
struct ctdb_req_call req;
struct ctdb_req_header *hdr;
struct iovec iov[2];
ssize_t nwritten;
- NTSTATUS status;
int ret;
ZERO_STRUCT(req);
ret = ctdb_read_req(conn, req.hdr.reqid, NULL, &hdr);
if (ret != 0) {
DEBUG(10, ("ctdb_read_req failed: %s\n", strerror(ret)));
- status = map_nt_error_from_unix(ret);
goto fail;
}
if (hdr->operation != CTDB_REPLY_CALL) {
DEBUG(0, ("received invalid reply\n"));
- status = NT_STATUS_INTERNAL_ERROR;
goto fail;
}
- status = NT_STATUS_OK;
fail:
TALLOC_FREE(hdr);
- return status;
+ return ret;
}
/*
double ctdb_time = 0;
int duration_msecs;
int lockret;
+ int ret;
if (!(result = talloc(mem_ctx, struct db_record))) {
DEBUG(0, ("talloc failed\n"));
((struct ctdb_ltdb_header *)ctdb_data.dptr)->flags : 0));
GetTimeOfDay(&ctdb_start_time);
- status = ctdbd_migrate(messaging_ctdbd_connection(), ctx->db_id,
- key);
+ ret = ctdbd_migrate(messaging_ctdbd_connection(), ctx->db_id,
+ key);
ctdb_time += timeval_elapsed(&ctdb_start_time);
- if (!NT_STATUS_IS_OK(status)) {
+ if (ret != 0) {
DEBUG(5, ("ctdb_migrate failed: %s\n",
- nt_errstr(status)));
+ strerror(ret)));
TALLOC_FREE(result);
return NULL;
}