diff options
author | Kirill Smelkov <kirr@landau.phys.spbu.ru> | 2010-09-19 13:53:29 +0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-10-07 15:11:26 +1030 |
commit | 665b3fbaa7435776befeb38d579b07cf7979fbcb (patch) | |
tree | b32aa977611d55bfedc6aee537959ecae5854add /ctdb/lib | |
parent | f1a720f08f48386e06f7cf7ddfd9175bf039a54c (diff) | |
download | samba-665b3fbaa7435776befeb38d579b07cf7979fbcb.tar.gz samba-665b3fbaa7435776befeb38d579b07cf7979fbcb.tar.xz samba-665b3fbaa7435776befeb38d579b07cf7979fbcb.zip |
pytdb: Add support for tdb_freelist_size()
Cc: 597386@bugs.debian.org
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
(This used to be ctdb commit dcdd83e6d6786f0857acdf9aa04bca74a7ccf14d)
Diffstat (limited to 'ctdb/lib')
-rw-r--r-- | ctdb/lib/tdb/pytdb.c | 6 | ||||
-rw-r--r-- | ctdb/lib/tdb/python/tests/simple.py | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ctdb/lib/tdb/pytdb.c b/ctdb/lib/tdb/pytdb.c index e20c79aa8f..2f0580f1d8 100644 --- a/ctdb/lib/tdb/pytdb.c +++ b/ctdb/lib/tdb/pytdb.c @@ -414,6 +414,11 @@ static PyObject *obj_get_map_size(PyTdbObject *self, void *closure) return PyInt_FromLong(tdb_map_size(self->ctx)); } +static PyObject *obj_get_freelist_size(PyTdbObject *self, void *closure) +{ + return PyInt_FromLong(tdb_freelist_size(self->ctx)); +} + static PyObject *obj_get_flags(PyTdbObject *self, void *closure) { return PyInt_FromLong(tdb_get_flags(self->ctx)); @@ -433,6 +438,7 @@ static PyObject *obj_get_seqnum(PyTdbObject *self, void *closure) static PyGetSetDef tdb_object_getsetters[] = { { (char *)"hash_size", (getter)obj_get_hash_size, NULL, NULL }, { (char *)"map_size", (getter)obj_get_map_size, NULL, NULL }, + { (char *)"freelist_size", (getter)obj_get_freelist_size, NULL, NULL }, { (char *)"flags", (getter)obj_get_flags, NULL, NULL }, { (char *)"max_dead", NULL, (setter)obj_set_max_dead, NULL }, { (char *)"filename", (getter)obj_get_filename, NULL, (char *)"The filename of this TDB file."}, diff --git a/ctdb/lib/tdb/python/tests/simple.py b/ctdb/lib/tdb/python/tests/simple.py index 0dae96e4dd..ea1ccd2d49 100644 --- a/ctdb/lib/tdb/python/tests/simple.py +++ b/ctdb/lib/tdb/python/tests/simple.py @@ -89,6 +89,9 @@ class SimpleTdbTests(TestCase): def test_map_size(self): self.tdb.map_size + def test_freelist_size(self): + self.tdb.freelist_size + def test_name(self): self.tdb.filename |