1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

11 Commits

Author SHA1 Message Date
Ronnie Sahlberg
f94291c37d Make the call to free the request explicit in the callback
instead of implicit

(This used to be ctdb commit 573e4e2d2bd09dd9579150cce926de774a0b609c)
2010-06-02 13:49:34 +10:00
Ronnie Sahlberg
e999119d40 Automatically free the request once the callback has returned.
(This used to be ctdb commit 2b3904d3113737d57ac0ec78f33ad163ed7f623c)
2010-06-02 13:42:03 +10:00
Ronnie Sahlberg
212ee831b8 add a sync wrapper for the getpnn control
(This used to be ctdb commit 01c2acdf3cb29bb44c74d9d792cf1d3706534ad2)
2010-06-02 10:36:19 +10:00
Ronnie Sahlberg
2f188c6422 Update the tst.c example application for libctdb to
use the headers from /usr/include
and add a comment about how to compile it

(This used to be ctdb commit c0f38e0936c487b63964fd9cef7a9370f227275f)
2010-06-02 09:24:17 +10:00
Ronnie Sahlberg
cb5210043d add a gplv3 boilerplate to the example application for libctdb
(This used to be ctdb commit 53df35aff1e10201a38931bbb82fb266a38892c0)
2010-05-26 13:55:19 +10:00
Rusty Russell
bd8d302589 libctdb: tweak interface for readrecordlock
Previously we could hang in poll with the callback pending (since we
fake it): explicitly call it immediately.

Note: I experienced corruption using DLIST_ADD_END (ctdb->pnn was blatted
when adding to the message_handler list).  I switched them all to DLIST_ADD,
but maybe I'm using it wrong?

(This used to be ctdb commit 3727165f0d206999d2cfc2800ff8868640868c7c)
2010-05-24 13:52:17 +09:30
Rusty Russell
30f4d01df1 libctdb: uniform callbacks, _recv functions to pull out data.
This is a bit tricky for those cases where we need to do multiple or
zero I/Os (eg. attachdb and readrecordlock), but works well for the
simple cases.

(This used to be ctdb commit ebe4dd724338c156423cfdcc10a75b68c2084cde)
2010-05-24 13:17:36 +09:30
Rusty Russell
f45cf4a711 tst.c: update to Ronnie's latest
This provides a slightly more comprehensive test of the library.

(This used to be ctdb commit f36e891c00c63d5b9dfbaddacff86d9da72d3bb7)
2010-05-20 16:16:04 +09:30
Rusty Russell
1dc7f2c4f8 libctdb: first cut, supports getrecmaster only
This is a completely standalone library using only ctdb_protocol.h.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Header from folded patch 'libctdb-message-handling.patch':

libctdb: add message handling to libctdb.

Now clients can send and receive ctdb messages.


(This used to be ctdb commit 732cf6ead4aa2fbefc2b81328171f52c8d935341)
2010-05-21 12:07:41 +09:30
Rusty Russell
7046a1ad0a libctdb: API changes from Ronnie's version
These simplifications mostly came up due to the implementation.

o Rename ctdb_context to ctdb_connection.
   We already have a ctdb_context internally in ctdbd; don't confuse them!
o Rename ctdb_handle to struct ctdb_request.
   From the user POV it's a request, and it's also useful internally to
   avoid implicit cast to/from void *.
o Rename ctdb_db_context to ctdb_db.
o Introduce ctdb_lock.
   This provides an explicit "lock object" you get from readrecordlock
   and have to hand to those functions which need you to hold a lock.
o status args are "int" not int32_t.
   Should this be a bool?
o Remove last traces on generic callback.
   Without semi-sync API, this doesn't help anything and loses type safety.
o Remove the semi-async API.
   We can add this later, but I think a sync and async API is enough for
   our poor users for the moment :)
o Registering a message handler also takes a callback.
   This way you can tell if it failed.  Not sure if this is overkill, but it's
   consistent.
o ctdb_service() takes an revents arg
   Strictly not necessary for a nonblocking fd, but nice to know if a
   read or write is possible.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit 86e1f93df856f9627182ed0e18bfcff6866c0954)
2010-05-20 16:07:30 +09:30
Rusty Russell
bbfb992f55 libctdb: ctdb.h and tst.c from Ronnie
This imports ctdb.h and tst.c from Ronnie's work: it's a separate commit
for now to make the changes obvious.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit 09f05cbfc883e5aac33d3781b163cde178ece4cf)
2010-05-20 16:01:28 +09:30