lafs_dir_handle_orphan no longer requires drop_orphan,
and can drop the reference to the orphan block.
So we need to hold our own so we can test if it is still
and orphan after handling (in which case we must wait).
struct datablock *db;
DEFINE_WAIT(wq);
while ((db = lafs_find_orphan(inode))) {
+ int still_orphan;
prepare_to_wait(&fs->async_complete, &wq,
TASK_UNINTERRUPTIBLE);
+ getdref(db, MKREF(rmdir_orphan));
lafs_dir_handle_orphan(db);
- if (lafs_drop_orphan(fs, db) == 0)
+ still_orphan = test_bit(B_Orphan, &db->b.flags);
+ putdref(db, MKREF(rmdir_orphan));
+ if (still_orphan)
/* still an orphan, need to wait */
schedule();
}