From 8bebb380e8b581b41f3057c128d73094c1bde332 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 1 Mar 2010 14:28:22 +0100 Subject: s3: Add connections_forall_read() In a cluster, this makes a large difference: For r/w traverse, we have to do a fetch_locked on every record which for most users of connections_forall is just overkill. --- source3/web/statuspage.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source3/web') diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c index f94ffb7926..e633036de3 100644 --- a/source3/web/statuspage.c +++ b/source3/web/statuspage.c @@ -182,8 +182,7 @@ static void print_share_mode(const struct share_mode_entry *e, /* kill off any connections chosen by the user */ -static int traverse_fn1(struct db_record *rec, - const struct connections_key *key, +static int traverse_fn1(const struct connections_key *key, const struct connections_data *crec, void *private_data) { @@ -199,8 +198,7 @@ static int traverse_fn1(struct db_record *rec, } /* traversal fn for showing machine connections */ -static int traverse_fn2(struct db_record *rec, - const struct connections_key *key, +static int traverse_fn2(const struct connections_key *key, const struct connections_data *crec, void *private_data) { @@ -224,8 +222,7 @@ static int traverse_fn2(struct db_record *rec, } /* traversal fn for showing share connections */ -static int traverse_fn3(struct db_record *rec, - const struct connections_key *key, +static int traverse_fn3(const struct connections_key *key, const struct connections_data *crec, void *private_data) { @@ -325,7 +322,7 @@ void status_page(void) PID_or_Machine = 0; } - connections_forall(traverse_fn1, NULL); + connections_forall_read(traverse_fn1, NULL); initPid2Machine (); @@ -415,7 +412,7 @@ void status_page(void) } printf("\n"); - connections_forall(traverse_fn2, NULL); + connections_forall_read(traverse_fn2, NULL); printf("

\n"); @@ -424,7 +421,7 @@ void status_page(void) printf("%s%s%s%s%s%s\n\n", _("Share"), _("User"), _("Group"), _("PID"), _("Client"), _("Date")); - connections_forall(traverse_fn3, NULL); + connections_forall_read(traverse_fn3, NULL); printf("

\n"); -- cgit