From 3d242c4571f3d07f76802f08811ccb34f212c315 Mon Sep 17 00:00:00 2001 From: Nathan Bryant Date: Sun, 29 Jul 2001 20:56:09 +0000 Subject: [PATCH] change ForEachRoom to use read-only cursors by default. it can be overridden to still use read/write cursors by doing: cdb_begin_transaction(); ForEachRoom(...); cdb_end_transaction(); the only place I found where it appears necessary to do so is check_ref_counts, so this checkin affects that function too. --- citadel/ChangeLog | 12 +++++++++++- citadel/housekeeping.c | 2 ++ citadel/room_ops.c | 2 -- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 4ac00e2da..4066afaaf 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,15 @@ $Log$ + Revision 580.14 2001/07/29 20:56:09 nbryant + change ForEachRoom to use read-only cursors by default. it can be overridden to + still use read/write cursors by doing: + + cdb_begin_transaction(); + ForEachRoom(...); + cdb_end_transaction(); + + the only place I found where it appears necessary to do so is check_ref_counts, + so this checkin affects that function too. + Revision 580.13 2001/07/29 20:06:33 nbryant generate symlinks to .libs in modules directory @@ -2622,4 +2633,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index 5cfea179a..c5b33081d 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -109,7 +109,9 @@ void check_ref_counts(void) { putfloor(&flbuf, a); } + cdb_begin_transaction(); ForEachRoom(check_ref_counts_backend, NULL); + cdb_end_transaction(); } /* diff --git a/citadel/room_ops.c b/citadel/room_ops.c index 4ba90922c..3566a66ec 100644 --- a/citadel/room_ops.c +++ b/citadel/room_ops.c @@ -354,7 +354,6 @@ void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data), struct quickroom qrbuf; struct cdbdata *cdbqr; - cdb_begin_transaction(); cdb_rewind(CDB_QUICKROOM); while (cdbqr = cdb_next_item(CDB_QUICKROOM), cdbqr != NULL) { @@ -367,7 +366,6 @@ void ForEachRoom(void (*CallBack) (struct quickroom *EachRoom, void *out_data), if (qrbuf.QRflags & QR_INUSE) (*CallBack)(&qrbuf, in_data); } - cdb_end_transaction(); } -- 2.30.2