diff options
author | Martin Schwenke <martin@meltin.net> | 2011-11-11 13:56:46 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-11-11 14:31:50 +1100 |
commit | f186dd90b6c0f1bcab5745650ebcf2772af95223 (patch) | |
tree | 8e12dd467537eac597c9f384e20e2a8dedb319b7 /ctdb/server/ctdb_ltdb_server.c | |
parent | 52ff4859581f13fff53499e0f0daffebd5492910 (diff) | |
download | samba-f186dd90b6c0f1bcab5745650ebcf2772af95223.tar.gz samba-f186dd90b6c0f1bcab5745650ebcf2772af95223.tar.xz samba-f186dd90b6c0f1bcab5745650ebcf2772af95223.zip |
Move some common functions to common/ctdb_ltdb.c
Move identical copies of ctdb_null_func(), ctdb_fetch_func(),
ctdb_fetch_with_header_func() from ctdb_client.c and
ctdb_ltdb_server.c to somewhere common.
This is in the context of wanting to run CCAN-style tests where most
of the ctdbd code is just included in the test program.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 126cb0d369b2b1aed63801dc4ba0554399e8b7e4)
Diffstat (limited to 'ctdb/server/ctdb_ltdb_server.c')
-rw-r--r-- | ctdb/server/ctdb_ltdb_server.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c index b1f29d77ec..8423388433 100644 --- a/ctdb/server/ctdb_ltdb_server.c +++ b/ctdb/server/ctdb_ltdb_server.c @@ -32,45 +32,6 @@ #define PERSISTENT_HEALTH_TDB "persistent_health.tdb" -/* - this is the dummy null procedure that all databases support -*/ -static int ctdb_null_func(struct ctdb_call_info *call) -{ - return 0; -} - -/* - this is a plain fetch procedure that all databases support -*/ -static int ctdb_fetch_func(struct ctdb_call_info *call) -{ - call->reply_data = &call->record_data; - return 0; -} - -/* - this is a plain fetch procedure that all databases support - this returns the full record including the ltdb header -*/ -static int ctdb_fetch_with_header_func(struct ctdb_call_info *call) -{ - call->reply_data = talloc(call, TDB_DATA); - if (call->reply_data == NULL) { - return -1; - } - call->reply_data->dsize = sizeof(struct ctdb_ltdb_header) + call->record_data.dsize; - call->reply_data->dptr = talloc_size(call->reply_data, call->reply_data->dsize); - if (call->reply_data->dptr == NULL) { - return -1; - } - memcpy(call->reply_data->dptr, call->header, sizeof(struct ctdb_ltdb_header)); - memcpy(&call->reply_data->dptr[sizeof(struct ctdb_ltdb_header)], call->record_data.dptr, call->record_data.dsize); - - return 0; -} - - /** * write a record to a normal database * |