Flush if we can not get logbuffer memory

parent 8ae3234e
......@@ -3289,14 +3289,23 @@ logbuffer_getblk(struct fellow_fd *ffd,
{
struct fellow_disk_log_block *blk;
struct fellow_alloc_log_block ablk[1];
unsigned canflush, wait;
if (new == GET_USED &&
lbuf->active.block &&
lbuf->active.block->nentries < FELLOW_DISK_LOG_BLOCK_ENTRIES)
return (lbuf->active.block);
blk = fellow_logblk_new(lbuf, 1,
ffd->tune->hash_log, lbuf->id);
canflush =
logbuffer_can(lbuf, LBUF_CAN_FLUSH) ||
logbuffer_can(lbuf, LBUF_CAN_LOGREG);
for (blk = NULL, wait = 0; blk == NULL && wait < 2; wait++) {
blk = fellow_logblk_new(lbuf, wait,
ffd->tune->hash_log, lbuf->id);
if (blk == NULL && canflush)
logbuffer_flush(ffd, lbuf, 0, LBUF_ALL);
}
XXXAN(blk);
ablk->block = blk;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment