- When diskd got MODIO'ified, this important bit got dropped for some
reason. If we don't drain the queue sometimes in MsgSend, its
quite possible to run out of shared memory buffers. Probably event
more important, we don't want to have too many messages outstanding
without processing some replies back from the diskd daemons.
/*
- * $Id: store_dir_diskd.cc,v 1.2 2000/05/12 00:29:20 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.3 2000/05/12 03:32:24 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
#endif
static void storeDiskdStats(StoreEntry * sentry);
static void storeDiskdDirSync(SwapDir *);
-static void storeDiskdDirCallback(SwapDir *);
/*
* until the queue is below magic2. Otherwise, we simply return when we
* don't get a message.
*/
-static void
+void
storeDiskdDirCallback(SwapDir * SD)
{
diomsg M;
extern void storeDiskdShmPut(SwapDir *, int);
extern void *storeDiskdShmGet(SwapDir *, int *);
extern void storeDiskdHandle(diomsg * M);
+extern void storeDiskdDirCallback(SwapDir *);
/*
cbdataUnlock(M.callback_data);
assert(++send_errors < 100);
}
+ /*
+ * We have to drain the queue here if necessary. If we don't,
+ * then we can have a lot of messages in the queue (probably
+ * up to 2*magic1) and we can run out of shared memory buffers.
+ */
+ if (diskdinfo->away > diskdinfo->magic2)
+ storeDiskdDirCallback(sd);
return x;
}