void logfs_cleanup_journal(struct super_block *sb) { struct logfs_super *super = logfs_super(sb); btree_grim_visitor32(&super->s_reserved_segments, 0, NULL); kfree(super->s_compressed_je); kfree(super->s_je); }
static void account_shadows(struct super_block *sb) { struct logfs_super *super = logfs_super(sb); struct inode *inode = super->s_master_inode; struct logfs_inode *li = logfs_inode(inode); struct shadow_tree *tree = &super->s_shadow_tree; btree_grim_visitor64(&tree->new, (unsigned long)sb, account_shadow); btree_grim_visitor64(&tree->old, (unsigned long)sb, account_shadow); btree_grim_visitor32(&tree->segment_map, 0, NULL); tree->no_shadowed_segments = 0; if (li->li_block) { li->li_block->ops->free_block(sb, li->li_block); } BUG_ON((s64)li->li_used_bytes < 0); }
void logfs_cleanup_gc(struct super_block *sb) { struct logfs_super *super = logfs_super(sb); int i; if (!super->s_free_list.count) return; /* * FIXME: The btree may still contain a single empty node. So we * call the grim visitor to clean up that mess. Btree code should * do it for us, really. */ btree_grim_visitor32(&super->s_cand_tree, 0, NULL); logfs_cleanup_list(sb, &super->s_free_list); logfs_cleanup_list(sb, &super->s_reserve_list); for_each_area(i) logfs_cleanup_list(sb, &super->s_low_list[i]); logfs_cleanup_list(sb, &super->s_ec_list); }
static void account_shadows(struct super_block *sb) { struct logfs_super *super = logfs_super(sb); struct inode *inode = super->s_master_inode; struct logfs_inode *li = logfs_inode(inode); struct shadow_tree *tree = &super->s_shadow_tree; btree_grim_visitor64(&tree->new, (unsigned long)sb, account_shadow); btree_grim_visitor64(&tree->old, (unsigned long)sb, account_shadow); btree_grim_visitor32(&tree->segment_map, 0, NULL); tree->no_shadowed_segments = 0; if (li->li_block) { /* * We never actually use the structure, when attached to the * master inode. But it is easier to always free it here than * to have checks in several places elsewhere when allocating * it. */ li->li_block->ops->free_block(sb, li->li_block); } BUG_ON((s64)li->li_used_bytes < 0); }