1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

use ctdb_call_info, so struct ctdb_call can be used for top level call

(This used to be ctdb commit 05565ce504b75671566661199f5203a9ace31583)
This commit is contained in:
Andrew Tridgell 2007-01-25 15:19:16 +11:00
parent e90f9aa084
commit a8d382ffef
4 changed files with 8 additions and 8 deletions

View File

@ -49,10 +49,10 @@ static int ctdb_call_local(struct ctdb_context *ctdb, TDB_DATA key,
int call_id, TDB_DATA *call_data, TDB_DATA *reply_data,
uint32_t caller)
{
struct ctdb_call *c;
struct ctdb_call_info *c;
struct ctdb_registered_call *fn;
c = talloc(ctdb, struct ctdb_call);
c = talloc(ctdb, struct ctdb_call_info);
CTDB_NO_MEMORY(ctdb, c);
c->key = key;

View File

@ -50,7 +50,7 @@ enum my_functions {FUNC_INCR=1, FUNC_FETCH=2};
/*
ctdb call function to increment an integer
*/
static int incr_func(struct ctdb_call *call)
static int incr_func(struct ctdb_call_info *call)
{
if (call->record_data.dsize == 0) {
call->new_data = talloc(call, TDB_DATA);
@ -70,7 +70,7 @@ static int incr_func(struct ctdb_call *call)
/*
ctdb call function to fetch a record
*/
static int fetch_func(struct ctdb_call *call)
static int fetch_func(struct ctdb_call_info *call)
{
call->reply_data = &call->record_data;
return 0;

View File

@ -33,7 +33,7 @@ static int int_compare(int *i1, int *i2)
/*
add an integer into a record in sorted order
*/
static int sort_func(struct ctdb_call *call)
static int sort_func(struct ctdb_call_info *call)
{
if (call->call_data == NULL ||
call->call_data->dsize != sizeof(int)) {
@ -64,7 +64,7 @@ static int sort_func(struct ctdb_call *call)
/*
ctdb call function to fetch a record
*/
static int fetch_func(struct ctdb_call *call)
static int fetch_func(struct ctdb_call_info *call)
{
call->reply_data = &call->record_data;
return 0;

View File

@ -24,7 +24,7 @@
/*
structure passed to a ctdb call function
*/
struct ctdb_call {
struct ctdb_call_info {
TDB_DATA key; /* record key */
TDB_DATA record_data; /* current data in the record */
TDB_DATA *new_data; /* optionally updated record data */
@ -85,7 +85,7 @@ int ctdb_start(struct ctdb_context *ctdb);
const char *ctdb_errstr(struct ctdb_context *);
/* a ctdb call function */
typedef int (*ctdb_fn_t)(struct ctdb_call *);
typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
/*
setup a ctdb call function