- if (dp->d_ino == 0) {
- if (spccnt + dsize < newsize)
- panic("wdir: compact failed (1)");
-/*ZZ*/if(spccnt+dsize>512)panic("wdir: compact screwup");
- u.u_dent.d_reclen = spccnt + dsize;
- } else {
- if (spccnt < newsize)
- panic("wdir: compact failed (2)");
- u.u_dent.d_reclen = spccnt;
-/*ZZ*/if ((((char *)dp-bp->b_un.b_addr)&0x1ff)+dsize>512) panic("wdir: reclen");
- dp->d_reclen = dsize;
- dp = (struct direct *)((char *)dp + dsize);
- }
-/*ZZ*/if((((char*)dp-bp->b_un.b_addr)&0x1ff)+u.u_dent.d_reclen>512)panic("wdir: botch");
- bcopy(&u.u_dent, dp, newsize);
- bwrite(bp);
- u.u_pdir->i_flag |= IUPD|ICHG;
- iput(u.u_pdir);
-}
-
-/*
- * remove any inodes in the inode cache belonging to dev
- *
- * There should not be any active ones, return error if any are found
- * (nb: this is a user error, not a system err)
- *
- * Also, count the references to dev by block devices - this really
- * has nothing to do with the object of the procedure, but as we have
- * to scan the inode table here anyway, we might as well get the
- * extra benefit.
- *
- * this is called from sumount()/sys3.c when dev is being unmounted
- */
-#ifdef QUOTA
-iflush(dev, iq)
- dev_t dev;
- struct inode *iq;
-#else
-iflush(dev)
- dev_t dev;
-#endif
-{
- register struct inode *ip;
- register open = 0;
-
- for (ip = inode; ip < inodeNINODE; ip++) {
-#ifdef QUOTA
- if (ip != iq && ip->i_dev == dev)
-#else
- if (ip->i_dev == dev)
-#endif
- if (ip->i_count)
- return(-1);
- else {
- remque(ip);
- ip->i_forw = ip;
- ip->i_back = ip;
- /*
- * as i_count == 0, the inode was on the free
- * list already, just leave it there, it will
- * fall off the bottom eventually. We could
- * perhaps move it to the head of the free
- * list, but as umounts are done so
- * infrequently, we would gain very little,
- * while making the code bigger.
- */
-#ifdef QUOTA
- dqrele(ip->i_dquot);
- ip->i_dquot = NODQUOT;
-#endif
- }
- else if (ip->i_count && (ip->i_mode&IFMT)==IFBLK &&
- ip->i_rdev == dev)
- open++;
+ if (level > SINGLE && lastbn >= 0) {
+ last = lastbn % factor;
+ nb = bap[i];
+ if (nb != 0) {
+ error = indirtrunc(ip, nb, last, level - 1, &blkcount);
+ if (error)
+ allerror = error;
+ blocksreleased += blkcount;
+ }