use part->size

This commit is contained in:
rsc 2005-10-29 17:40:49 +00:00
parent a9ecda2da9
commit 1726f602fe

View file

@ -68,7 +68,6 @@ threadmain(int argc, char *argv[])
Arena *arena;
u64int offset, aoffset;
Part *part;
Dir *d;
uchar buf[8192];
ArenaHead head;
@ -98,9 +97,6 @@ threadmain(int argc, char *argv[])
ventifmtinstall();
statsinit();
if((d = dirstat(file)) == nil)
sysfatal("can't stat file %s: %r", file);
part = initpart(file, OREAD|ODIRECT);
if(part == nil)
sysfatal("can't open file %s: %r", file);
@ -114,9 +110,9 @@ threadmain(int argc, char *argv[])
head.version, ANameSize, head.name, head.blocksize,
head.size, head.clumpmagic);
if(aoffset+head.size > d->length)
if(aoffset+head.size > part->size)
sysfatal("arena is truncated: want %llud bytes have %llud\n",
head.size, d->length);
head.size, part->size);
partblocksize(part, head.blocksize);
initdcache(8 * MaxDiskBlock);