*/
LAFS_BUG(test_bit(B_Pinned, &ib->b.flags), &ib->b);
if (!hlist_unhashed(&ib->hash))
- hlist_del(&ib->hash);
+ hlist_del_init(&ib->hash);
/* delete from inode->free_index */
list_del_init(&ib->b.siblings);
list_move(&ib->b.lru, &togo);
list_del_init(&ib->b.siblings);
LAFS_BUG(!test_bit(B_OnFree, &ib->b.flags), &ib->b);
if (!hlist_unhashed(&ib->hash))
- hlist_del(&ib->hash);
+ hlist_del_init(&ib->hash);
list_move(&ib->b.lru, &togo);
freelist.freecnt--;
}
struct hlist_head *head =
&hash_table[ihash(ib->b.inode, ib->b.fileaddr, ib->depth)];
spin_lock(&lafs_hash_lock);
+ LAFS_BUG(!hlist_unhashed(&ib->hash), &ib->b);
hlist_add_head(&ib->hash, head);
spin_unlock(&lafs_hash_lock);
}
+void lafs_unhash_iblock(struct indexblock *ib)
+{
+ /* This block has been emptied and deleted and is no longer
+ * wanted in the hash tables
+ */
+ spin_lock(&lafs_hash_lock);
+ LAFS_BUG(hlist_unhashed(&ib->hash), &ib->b);
+ hlist_del_init(&ib->hash);
+ spin_unlock(&lafs_hash_lock);
+}
+
/* adopt blk into parent if possible.
*/
static void
REFARG);
void lafs_iblock_free(struct indexblock *ib);
void lafs_hash_iblock(struct indexblock *ib);
+void lafs_unhash_iblock(struct indexblock *ib);
void lafs_summary_update(struct fs *fs, struct inode *ino,
u64 oldphys, u64 newphys, int is_index, int phase,
if (ib) {
lafs_iolock_block(&ib->b);
ib->b.fileaddr = newaddr;
+ lafs_unhash_iblock(ib);
lafs_hash_iblock(ib);
lafs_iounlock_block(&ib->b);
putiref(ib, MKREF(readdr));
nxt = NULL;
if (ib->b.siblings.next != &ib->b.parent->children)
nxt = list_entry(ib->b.siblings.next, struct indexblock, b.siblings);
+ lafs_unhash_iblock(ib);
if (test_and_clear_bit(B_PrimaryRef, &ib->b.flags)) {
int cr = 0;
/* This was not incorporated yet, revert the uninc status */