* FIXME there should be a more general way to delay
* updates to the Youth block.
*/
- if (test_bit(FinalCheckpoint, &fs->fsstate) ||
- (db &&
- db->b.inode == fs->devs[*dev].segsum &&
- db->b.fileaddr == ((*seg) >> (fs->blocksize_bits
- - 1)))) {
+ if (!test_bit(FinalCheckpoint, &fs->fsstate) &&
+ !(db &&
+ db->b.inode == fs->devs[*dev].segsum &&
+ db->b.fileaddr == ((*seg) >> (fs->blocksize_bits
+ - 1)))) {
+ spin_unlock(&fs->lock);
+ if (db)
+ putdref(db, MKREF(youth));
+
+ db = lafs_get_block(fs->devs[*dev].segsum,
+ (*seg) >> (fs->blocksize_bits
+ - 1),
+ NULL, GFP_KERNEL,
+ MKREF(youth));
+ /* As we hold a ref on youth block for anything in the
+ * table, and that block was loaded at the time, it must
+ * still be valid.
+ */
+ BUG_ON(!test_bit(B_Valid, &db->b.flags));
+ goto again;
+ } else {
/* HACK youth_next should always be at least 0x8000 so that
* cleanable score differentiates well for new segments.
* old code would sometimes set youth_next very low, so
*dev, *seg, fs->youth_next - 1);
/* Note that we return an implicit reference to the ssum */
return;
- } else {
- spin_unlock(&fs->lock);
- if (db)
- putdref(db, MKREF(youth));
-
- db = lafs_get_block(fs->devs[*dev].segsum,
- (*seg) >> (fs->blocksize_bits
- - 1),
- NULL, GFP_KERNEL,
- MKREF(youth));
- /* As we hold a ref on youth block for anything in the
- * table, and that block was loaded at the time, it must
- * still be valid.
- */
- BUG_ON(!test_bit(B_Valid, &db->b.flags));
- goto again;
}
}