putdref(b, MKREF(orphanx));
/* If this was the last block in the file,
- * we need to punch a hole
+ * we need to punch a hole.
+ * i.e. if the first unneeded slot is at or before
+ * the first slot in this block, we don't want
+ * this block.
*/
- if (((om->nextfree + om->reserved + 1) >>
- (fs->prime_sb->s_blocksize_bits-4))
- != bnum)
+ if ((om->nextfree + om->reserved) <=
+ (bnum << (fs->prime_sb->s_blocksize_bits-4))
+ )
lafs_erase_dblock(b);
putdref(b, MKREF(orphan_reserve));