use part->size
This commit is contained in:
parent
a9ecda2da9
commit
1726f602fe
1 changed files with 2 additions and 6 deletions
|
|
@ -68,7 +68,6 @@ threadmain(int argc, char *argv[])
|
||||||
Arena *arena;
|
Arena *arena;
|
||||||
u64int offset, aoffset;
|
u64int offset, aoffset;
|
||||||
Part *part;
|
Part *part;
|
||||||
Dir *d;
|
|
||||||
uchar buf[8192];
|
uchar buf[8192];
|
||||||
ArenaHead head;
|
ArenaHead head;
|
||||||
|
|
||||||
|
|
@ -98,9 +97,6 @@ threadmain(int argc, char *argv[])
|
||||||
ventifmtinstall();
|
ventifmtinstall();
|
||||||
statsinit();
|
statsinit();
|
||||||
|
|
||||||
if((d = dirstat(file)) == nil)
|
|
||||||
sysfatal("can't stat file %s: %r", file);
|
|
||||||
|
|
||||||
part = initpart(file, OREAD|ODIRECT);
|
part = initpart(file, OREAD|ODIRECT);
|
||||||
if(part == nil)
|
if(part == nil)
|
||||||
sysfatal("can't open file %s: %r", file);
|
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.version, ANameSize, head.name, head.blocksize,
|
||||||
head.size, head.clumpmagic);
|
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",
|
sysfatal("arena is truncated: want %llud bytes have %llud\n",
|
||||||
head.size, d->length);
|
head.size, part->size);
|
||||||
|
|
||||||
partblocksize(part, head.blocksize);
|
partblocksize(part, head.blocksize);
|
||||||
initdcache(8 * MaxDiskBlock);
|
initdcache(8 * MaxDiskBlock);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue