-/*
- if ((ip->i_flag&ITEXT) && ip->i_nlink==1) {
- u.u_error = ETXTBSY;
- goto out;
- }
-*/
- if (u.u_count == 0) {
- /*
- * first entry in block, so set d_ino to zero.
- */
-/*ZZ*/if(u.u_offset&0x1ff)printf("missed dir compact dir %s/%d off %d file %s\n"
-/*ZZ*/,pp->i_fs->fs_fsmnt,pp->i_number,u.u_offset,u.u_dent.d_name);
- u.u_base = (caddr_t)&u.u_dent;
- u.u_count = DIRSIZ(&u.u_dent);
- u.u_dent.d_ino = 0;
- writei(pp);
- } else {
- /*
- * updating preceeding entry to skip over current entry.
- */
- fs = pp->i_fs;
- lbn = lblkno(fs, u.u_offset);
- base = blkoff(fs, u.u_offset);
- bn = fsbtodb(fs, bmap(pp, lbn, B_WRITE, base + u.u_count));
- bp = bread(pp->i_dev, bn, blksize(fs, pp, lbn));
- if (bp->b_flags & B_ERROR) {
- brelse(bp);
- goto out;
- }
- ((struct direct *)(bp->b_un.b_addr + base))->d_reclen +=
- u.u_dent.d_reclen;
-/*ZZ*/if(((int)(bp->b_un.b_addr + base)&0x1ff)+u.u_dent.d_reclen>512)
-/*ZZ*/ panic("unlink: reclen");
- bwrite(bp);
- pp->i_flag |= IUPD|ICHG;