X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fhousekeeping.c;h=e1c15e4924106d231ab1813bc6cc49747dc4d81f;hb=0cabe9fe1fa60973f5bf6ea4b09a9e9257d05109;hp=159169e6833adc880b6598fcffcfe0918794aeb7;hpb=bd5558cc184a82327ebd7a5110528cac3713ac1d;p=citadel.git diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index 159169e68..e1c15e492 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -40,7 +40,7 @@ void terminate_idle_sessions(void) { /* - * Main housekeeping function. + * Main housekeeping function. This gets run whenever a session terminates. */ void do_housekeeping() { @@ -63,3 +63,31 @@ void do_housekeeping() { } + +/* + * Check (and fix) floor reference counts. This doesn't need to be done + * very often, since the counts should remain correct during normal operation. + */ +void check_ref_counts() { + int ref[MAXFLOORS]; + struct quickroom qrbuf; + struct floor flbuf; + int a; + + for (a=0; a 0) flbuf.f_flags = flbuf.f_flags | QR_INUSE ; + lputfloor(&flbuf, a); + } + } +