X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamb%2Fisamb.c;h=0ade1bfb3f150e7865f896c479f174a8b03eaa7b;hb=d0d4772450cfe6afde24ed8ec4031afd2da56632;hp=1825184b364a1ee5e32f63648f4f66008b81b48f;hpb=89d16cf15eda0e4802d18b8ad09bd3653508ebfc;p=idzebra-moved-to-github.git diff --git a/isamb/isamb.c b/isamb/isamb.c index 1825184..0ade1bf 100644 --- a/isamb/isamb.c +++ b/isamb/isamb.c @@ -569,6 +569,10 @@ struct ISAMB_block *new_block(ISAMB b, int leaf, int cat) zint block_no; block_no = b->file[cat].head.last_block++; p->pos = block_no * CAT_MAX + cat; + if (b->log_freelist) + yaz_log(b->log_freelist, "got block " + ZINT_FORMAT " from last %d:" ZINT_FORMAT, p->pos, + cat, p->pos/CAT_MAX); } else { @@ -584,8 +588,10 @@ struct ISAMB_block *new_block(ISAMB b, int leaf, int cat) zebra_exit("isamb:new_block"); } } - yaz_log(b->log_freelist, "got block " ZINT_FORMAT " from freelist %d:" ZINT_FORMAT, p->pos, - cat, p->pos/CAT_MAX); + if (b->log_freelist) + yaz_log(b->log_freelist, "got block " + ZINT_FORMAT " from freelist %d:" ZINT_FORMAT, p->pos, + cat, p->pos/CAT_MAX); memcpy(&b->file[cat].head.free_list, p->buf, sizeof(zint)); } p->cat = cat; @@ -664,6 +670,7 @@ void close_block(ISAMB b, struct ISAMB_block *p) p->pos, p->cat, p->pos/CAT_MAX); memcpy(p->buf, &b->file[p->cat].head.free_list, sizeof(zint)); b->file[p->cat].head.free_list = p->pos; + b->file[p->cat].head_dirty = 1; if (!cache_block(b, p->pos, p->buf, 1)) { yaz_log(b->log_io, "bf_write: close_block (deleted)"); @@ -1668,6 +1675,7 @@ void isamb_set_root_ptr(ISAMB b, zint root_ptr) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab