1 a0d146ed 2005-07-12 devnull #include "stdinc.h"
2 a0d146ed 2005-07-12 devnull #include "dat.h"
3 a0d146ed 2005-07-12 devnull #include "fns.h"
6 a0d146ed 2005-07-12 devnull zeropart(Part *part, int blocksize)
8 a0d146ed 2005-07-12 devnull ZBlock *b;
9 a0d146ed 2005-07-12 devnull u64int addr;
12 a0d146ed 2005-07-12 devnull fprint(2, "clearing the partition\n");
13 a0d146ed 2005-07-12 devnull //fprint(2, "NOT!\n");
14 a0d146ed 2005-07-12 devnull //return;
15 a0d146ed 2005-07-12 devnull //b=alloczblock(MaxIoSize, 1, blocksize);
16 a0d146ed 2005-07-12 devnull //freezblock(b);
17 a0d146ed 2005-07-12 devnull b = alloczblock(MaxIoSize, 1, blocksize);
20 a0d146ed 2005-07-12 devnull for(addr = PartBlank; addr + MaxIoSize <= part->size; addr += MaxIoSize){
21 a0d146ed 2005-07-12 devnull if(writepart(part, addr, b->data, MaxIoSize) < 0)
22 a0d146ed 2005-07-12 devnull sysfatal("can't initialize %s, writing block %d failed: %r", part->name, w);
26 a0d146ed 2005-07-12 devnull for(; addr + blocksize <= part->size; addr += blocksize)
27 a0d146ed 2005-07-12 devnull if(writepart(part, addr, b->data, blocksize) < 0)
28 a0d146ed 2005-07-12 devnull sysfatal("can't initialize %s: %r", part->name);
30 a0d146ed 2005-07-12 devnull freezblock(b);