* clri filsys inumber ...
*/
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/ino.h>
+
#define ISIZE (sizeof(struct dinode))
-#define BSIZE 512
#define NI (BSIZE/ISIZE)
struct ino
{
status = 1;
continue;
}
- off = ((n-1)/NI + 2) * (long)512;
+ off = itod(n) * BSIZE;
lseek(f, off, 0);
if(read(f, (char *)buf, BSIZE) != BSIZE) {
printf("%s: read error\n", argv[i]);
for(i=2; i<argc; i++) {
n = atoi(argv[i]);
printf("clearing %u\n", n);
- off = ((n-1)/NI + 2) * (long)512;
+ off = itod(n) * BSIZE;
lseek(f, off, 0);
read(f, (char *)buf, BSIZE);
- j = (n-1)%NI;
+ j = itoo(n);
for(k=0; k<ISIZE; k++)
buf[j].junk[k] = 0;
lseek(f, off, 0);