int lafs_make_orphan_nb(struct fs *fs, struct datablock *db, struct inode *ino);
void lafs_orphan_release(struct fs *fs, struct datablock *b, struct inode *ino);
long lafs_run_orphans(struct fs *fs);
-int lafs_drop_orphan(struct fs *fs, struct datablock *db);
void lafs_add_orphan(struct fs *fs, struct datablock *db);
void lafs_orphan_forget(struct fs *fs, struct datablock *db);
struct datablock *lafs_find_orphan(struct inode *ino);
* There are "om->reserved" of these, typically all on the one block.
* "orphan" This is a block in the orphan file which holds an orphan
* record for some committed orphan. ->orphan_slot points here.
- * "orphan_list" This is a block (not in orphan file) which is an orphan, is
- * on the ->pending_orphans list and has a record in the orphan file.
+ * "orphan_flag" This is a block (not in orphan file) which is an orphan, and
+ * has the B_Orphan flag set.
* "orphanx", "orphan_release", "orphan_release2", "orphan_move"
* "orphan_fs", "orphan_ino", "orphan_blk" Temporary references
*/
/* Committed to being an orphan now */
b->orphan_slot = om->nextfree++;
set_bit(B_Orphan, &b->b.flags);
+ getdref(b, MKREF(orphan_flag));
lafs_add_orphan(fs, b);
dprintk("%p->orphan_slot=%d (%lu,%lu,%lu) %s\n", b, b->orphan_slot,
return err;
}
+static int lafs_drop_orphan(struct fs *fs, struct datablock *db);
/*
* When any processing of an orphan makes it not an orphan any more
* (e.g. link is created for a file, directory block is cleaned)
clear_bit(B_Orphan, &b->b.flags);
iput(ino);
lafs_drop_orphan(fs, b);
+ putdref(b, MKREF(orphan_flag));
/* Now drop the reservation we just synthesised */
orphan_abort(fs);
} else {
list_del_init(&db->orphans);
spin_unlock(&fs->lock);
- putdref(db, MKREF(orphan_list));
return 1;
}
}
*/
LAFS_BUG(!test_bit(B_Orphan, &db->b.flags), &db->b);
spin_lock(&fs->lock);
- if (list_empty(&db->orphans)) {
+ if (list_empty(&db->orphans))
list_add_tail(&db->orphans, &fs->pending_orphans);
- getdref(db, MKREF(orphan_list));
- }
+
spin_unlock(&fs->lock);
lafs_wake_thread(fs);
}
* it just now. When we do, lafs_add_orphan will be called */
LAFS_BUG(!test_bit(B_Orphan, &db->b.flags), &db->b);
spin_lock(&fs->lock);
- if (!list_empty(&db->orphans)) {
+ if (!list_empty(&db->orphans))
list_del_init(&db->orphans);
- spin_unlock(&fs->lock);
- putdref(db, MKREF(orphan_list));
- } else
- spin_unlock(&fs->lock);
+ spin_unlock(&fs->lock);
}
struct datablock *lafs_find_orphan(struct inode *ino)