From 97e2393335594d48a9b2ea7be18a2f9374acc207 Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 20 Jul 2006 20:35:03 +0000 Subject: [PATCH] add iterator operations to dt_index_operations --- lustre/include/dt_object.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 360a1da..4c0497d 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -234,6 +234,11 @@ struct dt_rec; struct dt_key; /* + * Incomplete type of dt iterator. + */ +struct dt_it; + +/* * Per-dt-object operations on object as index. */ struct dt_index_operations { @@ -253,6 +258,33 @@ struct dt_index_operations { */ int (*dio_delete)(const struct lu_context *ctxt, struct dt_object *dt, const struct dt_key *key, struct thandle *handle); + /* + * Iterator interface + */ + struct dt_it_ops { + /* + * Allocate and initialize new iterator. + * + * precondition: lu_object_exists(ctxt, &dt->do_lu); + */ + struct dt_it *(*init)(const struct lu_context *ctxt, + struct dt_object *dt); + void (*fini)(const struct lu_context *ctxt, + struct dt_it *di); + int (*get)(const struct lu_context *ctxt, + struct dt_it *di, + const struct dt_key *key); + void (*put)(const struct lu_context *ctxt, + struct dt_it *di); + int (*next)(const struct lu_context *ctxt, + struct dt_it *di); + struct dt_key *(*key)(const struct lu_context *ctxt, + const struct dt_it *di); + int (*key_size)(const struct lu_context *ctxt, + const struct dt_it *di); + struct dt_rec *(*rec)(const struct lu_context *ctxt, + const struct dt_it *di); + } dio_it; }; struct dt_device { -- 1.8.3.1