+ (void)printf("clearing %d\n", inonum);
+
+ /* read in the appropriate block. */
+ offset = itod(sbp, inonum); /* inode to fs block */
+ offset = fsbtodb(sbp, offset); /* fs block to disk block */
+ offset *= DEV_BSIZE; /* disk block to disk bytes */
+
+ /* seek and read the block */
+ if (lseek(fd, offset, SEEK_SET) < 0)
+ error();
+ if (read(fd, (char *)ibuf, bsize) != bsize)
+ error();
+
+ /* get the inode within the block. */
+ ip = &ibuf[itoo(sbp, inonum)];
+
+ /* clear the inode, and bump the generation count. */
+ generation = ip->di_gen + 1;
+ bzero((char *)ip, sizeof *ip);
+ ip->di_gen = generation;
+
+ /* backup and write the block */
+ if (lseek(fd, -bsize, SEEK_CUR) < 0)
+ error();
+ if (write(fd, (char *)ibuf, bsize) != bsize)
+ error();
+ (void)fsync(fd);