Removed warning message when commiting flat shadow files.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: cfile.c,v $
- * Revision 1.14 1996-04-12 07:01:55 adam
+ * Revision 1.15 1996-04-18 16:02:56 adam
+ * Changed logging a bit.
+ * Removed warning message when commiting flat shadow files.
+ *
+ * Revision 1.14 1996/04/12 07:01:55 adam
* Yet another bug fix (next_block was initialized to 0; now set to 1).
*
* Revision 1.13 1996/04/09 14:48:49 adam
int hash_bytes;
cf->rmf = mf;
- logf (LOG_LOG, "cf_open %s", cf->rmf->name);
+ logf (LOG_LOG, "cf_open %s %s", cf->rmf->name, wflag ? "rdwr" : "rd");
sprintf (path, "%s-b", fname);
if (!(cf->block_mf = mf_open (area, path, block_size, wflag)))
{
assert (cf->head.hash_size > 2);
hash_bytes = cf->head.hash_size * sizeof(int);
assert (cf->head.next_bucket > 0);
+ assert (cf->head.next_block > 0);
if (cf->head.state == 1)
cf->array = xmalloc (hash_bytes);
else
xfree (cf->parray);
cf->parray = NULL;
cf->head.state = 2;
+ cf->dirty = 1;
}
static int cf_lookup (CFile cf, int no)
int cf_close (CFile cf)
{
- logf (LOG_LOG, "cf_close %s", cf->rmf->name);
logf (LOG_LOG, "hits=%d miss=%d bucket_in_memory=%d total=%d",
cf->no_hits, cf->no_miss, cf->bucket_in_memory,
cf->head.next_bucket - cf->head.first_bucket);
flush_bucket (cf, -1);
if (cf->dirty)
{
+ logf (LOG_LOG, "dirty. write header");
mf_write (cf->hash_mf, 0, 0, sizeof(cf->head), &cf->head);
write_head (cf);
}
xfree (cf->parray);
xfree (cf->iobuf);
xfree (cf);
+ logf (LOG_LOG, "cf_close %s", cf->rmf->name);
return 0;
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: cfile.h,v $
- * Revision 1.7 1996-02-07 14:03:48 adam
+ * Revision 1.8 1996-04-18 16:02:56 adam
+ * Changed logging a bit.
+ * Removed warning message when commiting flat shadow files.
+ *
+ * Revision 1.7 1996/02/07 14:03:48 adam
* Work on flat indexed shadow files.
*
* Revision 1.6 1996/02/07 10:08:45 adam
#ifndef CFILE_H
#define CFILE_H
-#define HASH_BUCKET 31
+#define HASH_BUCKET 15
struct CFile_hash_bucket {
struct CFile_ph_bucket {
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: commit.c,v $
- * Revision 1.9 1996-04-12 07:01:57 adam
+ * Revision 1.10 1996-04-18 16:02:56 adam
+ * Changed logging a bit.
+ * Removed warning message when commiting flat shadow files.
+ *
+ * Revision 1.9 1996/04/12 07:01:57 adam
* Yet another bug fix (next_block was initialized to 0; now set to 1).
*
* Revision 1.8 1996/02/07 14:03:49 adam
fp = xmalloc (HASH_BSIZE);
for (hno = cf->head.next_bucket; hno < cf->head.flat_bucket; hno++)
{
- if (hno == cf->head.next_bucket || hno == cf->head.flat_bucket-1)
+ if (hno == cf->head.flat_bucket-1)
{
for (i = 0; i < (HASH_BSIZE/sizeof(int)); i++)
fp[i] = 0;
}
- if (!mf_read (cf->hash_mf, hno, 0, 0, fp))
+ if (!mf_read (cf->hash_mf, hno, 0, 0, fp) &&
+ hno != cf->head.flat_bucket-1)
{
- logf (LOG_WARN, "read index block hno=%d (%d-%d) commit",
- hno, cf->head.next_bucket,
- cf->head.flat_bucket-1);
+ logf (LOG_FATAL, "read index block hno=%d (%d-%d) commit",
+ hno, cf->head.next_bucket, cf->head.flat_bucket-1);
}
for (i = 0; i < (HASH_BSIZE/sizeof(int)); i++)
{