Commit 07fabe28 authored by Mike Hibler's avatar Mike Hibler

I was still over-filling the chunk header.

parent 84f368aa
......@@ -377,6 +377,7 @@ initnewchunk(struct chunkstate *cstate, struct ndz_file *ndz)
cstate->region = (struct region *)(hdr + 1);
cstate->curregion = cstate->region;
cstate->headerleft = hdr->regionsize - sizeof(blockhdr_t);
return 0;
}
......@@ -425,17 +426,16 @@ chunkify(struct ndz_rangemap *mmap, struct ndz_range *range, void *arg)
return 1;
cstate->header->firstsect = rstart;
cstate->curregion->start = rstart;
cstate->headerleft = cstate->header->regionsize;
if (delta.ndz->relocentries > 0) {
/*
* Account for relocations.
* XXX we don't know how many relocs will wind up in this chunk
* so we have to assume that all remaining ones will.
*/
/*
* Account for relocations.
* XXX we don't know how many relocs will wind up in this chunk
* so we have to assume that all remaining ones will.
*/
if (delta.ndz->relocentries > 0)
cstate->headerleft -=
(ndz_reloc_inrange(delta.ndz, rstart, 0) *
sizeof(struct blockreloc));
}
}
/*
......@@ -583,7 +583,6 @@ chunkify(struct ndz_rangemap *mmap, struct ndz_range *range, void *arg)
return 1;
cstate->header->firstsect = pstart;
cstate->curregion->start = pstart;
cstate->headerleft = cstate->header->regionsize;
if (delta.ndz->relocentries > 0)
cstate->headerleft -=
(ndz_reloc_inrange(delta.ndz, pstart, 0) *
......
......@@ -323,6 +323,7 @@ initnewchunk(struct chunkstate *cstate, struct ndz_file *ndz)
cstate->region = (struct region *)(hdr + 1);
cstate->curregion = cstate->region;
cstate->headerleft = hdr->regionsize - sizeof(blockhdr_t);
return 0;
}
......@@ -371,17 +372,15 @@ chunkify(struct ndz_rangemap *mmap, struct ndz_range *range, void *arg)
return 1;
cstate->header->firstsect = rstart;
cstate->curregion->start = rstart;
cstate->headerleft = cstate->header->regionsize;
if (new.ndz->relocentries > 0) {
/*
* Account for relocations.
* XXX we don't know how many relocs will wind up in this chunk
* so we have to assume that all remaining ones will.
*/
/*
* Account for relocations.
* XXX we don't know how many relocs will wind up in this chunk
* so we have to assume that all remaining ones will.
*/
if (new.ndz->relocentries > 0)
cstate->headerleft -=
(ndz_reloc_inrange(new.ndz, rstart, 0) *
sizeof(struct blockreloc));
}
}
/*
......@@ -538,7 +537,6 @@ chunkify(struct ndz_rangemap *mmap, struct ndz_range *range, void *arg)
return 1;
cstate->header->firstsect = pstart;
cstate->curregion->start = pstart;
cstate->headerleft = cstate->header->regionsize;
if (new.ndz->relocentries > 0)
cstate->headerleft -=
(ndz_reloc_inrange(new.ndz, pstart, 0) *
......
......@@ -583,6 +583,7 @@ initnewchunk(struct chunkstate *cstate, struct ndz_file *ndz)
cstate->region = (struct region *)(hdr + 1);
cstate->curregion = cstate->region;
cstate->headerleft = hdr->regionsize - sizeof(blockhdr_t);
return 0;
}
......@@ -638,17 +639,15 @@ chunkify(struct ndz_rangemap *mmap, struct ndz_range *range, void *arg)
return 1;
cstate->header->firstsect = rstart;
cstate->curregion->start = rstart;
cstate->headerleft = cstate->header->regionsize;
if (delta.ndz->relocentries > 0) {
/*
* Account for relocations.
* XXX we don't know how many relocs will wind up in this chunk
* so we have to assume that all remaining ones will.
*/
/*
* Account for relocations.
* XXX we don't know how many relocs will wind up in this chunk
* so we have to assume that all remaining ones will.
*/
if (delta.ndz->relocentries > 0)
cstate->headerleft -=
(ndz_reloc_inrange(new.ndz, rstart, 0) *
sizeof(struct blockreloc));
}
}
/*
......@@ -808,7 +807,6 @@ chunkify(struct ndz_rangemap *mmap, struct ndz_range *range, void *arg)
return 1;
cstate->header->firstsect = pstart;
cstate->curregion->start = pstart;
cstate->headerleft = cstate->header->regionsize;
if (delta.ndz->relocentries > 0)
cstate->headerleft -=
(ndz_reloc_inrange(new.ndz, pstart, 0) *
......
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