u32 seg;
u32 offset;
int order = 0;
+ struct list_head pending;
fs->phase = 1;
fs->qphase = 0;
/* Now we release all the nlink==0 inodes that we found */
- while (!list_empty(&fs->pending_orphans)) {
- struct datablock *db = list_entry(fs->pending_orphans.next,
- struct datablock,
- orphans);
+ INIT_LIST_HEAD(&pending);
+ list_splice_init(&fs->pending_orphans, &pending);
+ while (!list_empty(&pending)) {
+ struct datablock *db = list_first_entry(&pending,
+ struct datablock,
+ orphans);
list_del_init(&db->orphans);
+ if (db->my_inode->i_nlink == 0)
+ lafs_make_orphan(fs, db);
lafs_iput_fs(db->my_inode);
putdref(db, MKREF(roll_orphan));
}