X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamb%2Fisamb.c;h=4c1c803a8129193cb0feec0c64471581caa9799e;hb=41e30333ebf8aa8a0c2e7403975bfb01d4bd87ac;hp=13bb0cf62a6480870e76a2e11334fbb99456b003;hpb=6a0f9234f945bc4956e2bcef75f715661a9eba9a;p=idzebra-moved-to-github.git diff --git a/isamb/isamb.c b/isamb/isamb.c index 13bb0cf..4c1c803 100644 --- a/isamb/isamb.c +++ b/isamb/isamb.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -569,6 +572,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 +591,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 +673,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)");